Support Forums

External file.php into 68c - way to do it?

This is a discussion on External file.php into 68c - way to do it? within the v3.1 Modules & Modifications forums, part of the Legacy Help & Support category; I need to load an external php file. I might need it for a guest book, php form or full ...


Go Back   68 Classifieds Forums > Archives > Legacy Help & Support > v3.1 Modules & Modifications

 
 
Thread Tools Display Modes
Old 12-17-2006, 06:32 PM   #1
Senior Member
 
Join Date: Dec 2006
Posts: 110
Rep Power: 15
darek is on a distinguished road
Default External file.php into 68c - way to do it?

I need to load an external php file. I might need it for a guest book, php form or full featured search. OK, every thing is easy if we load it into a php file like index.php. But this mean the feature would be available only for index.php. If I loaded it into layout.tpl.php - the feature would be available throughout the page. Is it possible? This will solve me a lot of problems. Thanks in advance.
darek is offline  
Old 12-17-2006, 06:53 PM   #2
Coder
 
Join Date: Mar 2006
Posts: 4,798
Rep Power: 117
Lhotch is a glorious beacon of light Lhotch is a glorious beacon of light Lhotch is a glorious beacon of light
Default

http://smarty.php.net/manual/en/lang...nction.php.php
__________________
Larry

Knowledge learned is more valuable than knowledge given.
Lhotch is offline  
Old 12-17-2006, 07:06 PM   #3
Senior Member
 
Join Date: Dec 2006
Posts: 110
Rep Power: 15
darek is on a distinguished road
Default

THANKS a lot!
darek is offline  
Old 12-17-2006, 07:17 PM   #4
Senior Member
 
Join Date: Dec 2006
Posts: 110
Rep Power: 15
darek is on a distinguished road
Default

Need help again. I want to have full search on main page, to do that I need to include search.php. When I included it to index.php - it worked, but when I included it to layout.tpl.php
using:
PHP Code:
{php}
   
// including a php script directly from the template.
   
include('search.php');
{/
php
I got this error
Fatal error: Call to a member function on a non-object in search.php on line 21

What did I do wrong?
darek is offline  
Old 12-17-2006, 10:25 PM   #5
Moderator
 
juven14's Avatar
 
Join Date: Mar 2006
Location: Texas
Posts: 1,961
Rep Power: 58
juven14 is a jewel in the rough
Default

I put a link in your other post regarding the search plugin. Here it is again, I think there are a few other posts that cover this topic as well.

http://www.68classifieds.com/forums/...=search+plugin
__________________
John Snyder
PHP Developer
juven14 is offline  
Old 12-18-2006, 10:53 AM   #6
Coder
 
Join Date: Mar 2006
Posts: 4,798
Rep Power: 117
Lhotch is a glorious beacon of light Lhotch is a glorious beacon of light Lhotch is a glorious beacon of light
Default

Quote:
Originally Posted by darek
Need help again. I want to have full search on main page, to do that I need to include search.php. When I included it to index.php - it worked, but when I included it to layout.tpl.php
using:
PHP Code:
{php}
   
// including a php script directly from the template.
   
include('search.php');
{/
php
I got this error
Fatal error: Call to a member function on a non-object in search.php on line 21

What did I do wrong?
I didnt realize you wanted to call an existing 68c *.php file.

68C php files are designed to use smarty for their presentation so they in and of themselves dont output anything, the pass variables to smarty for display.
__________________
Larry

Knowledge learned is more valuable than knowledge given.
Lhotch is offline  
Old 12-18-2006, 10:55 AM   #7
68 Classifieds Staff
 
Eric Barnes's Avatar
 
Join Date: Mar 2006
Location: Belmont, NC
Posts: 5,229
Rep Power: 123
Eric Barnes is a jewel in the rough
Default

As a workaround if you only want the search page for the home page you could rename search.php to index.php then it will load first by default.
__________________
Eric Barnes
68 Classifieds Developer
Customer Area | Issue Tracker | Documentation | 68C Mods | 68 @ Twitter | My Modules
Eric Barnes is offline  
Old 12-18-2006, 03:55 PM   #8
Senior Member
 
Join Date: Dec 2006
Posts: 110
Rep Power: 15
darek is on a distinguished road
Default

Unfortunately I thought of a full featured search through out the site, so I need to laod it pernamently. Either with a template or php files.
darek is offline  
 

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
External link in navigation Harry v3.1 Questions & Support 2 11-06-2006 07:27 PM
Allow External URL? doc1975 v3.1 Questions & Support 2 10-30-2006 03:06 PM


All times are GMT -4. The time now is 08:44 PM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0