Modifying templates...
 
Notifications
Clear all

Modifying templates & PHP files

3 Posts
2 Users
0 Reactions
2,077 Views
(@mickinell)
Posts: 62
Trusted Member
Topic starter
 

I read another post on using template.php to place elements, and I had a successful test with that:

require ("/smf/SSI.php");
$current = "home";

include ("header.php");

//make a new TemplatePower object

if(file_exists("$skindir/index.tpl")) $tpl = new TemplatePower( "$skindir/index.tpl" );
else $tpl = new TemplatePower("default_tpls/index.tpl");
//let TemplatePower do its thing, parsing etc.

include("includes/pagesetup.php");
$query = dbquery("SELECT message_text FROM ".TABLEPREFIX."fanfiction_messages WHERE message_name = 'welcome'");
list($welcome) = dbrow($query);
session_start( );
loadUserSettings( );
$output .= '<a href="" http://www.mickiclark.com/smf/index.php?action=logout;sesc='.$sc.' ;" ">Functional logout link</a>';
$tpl->assign("welcome", stripslashes($welcome));
$tpl->assign("logoutsmf", $output);
$tpl->printToScreen();
dbclose( );
?>

Then I modifed my index.tpl and inserted {logoutsmf} after the Welcome message, and lo and behold---it displayed.

The problem is that I don't want the SMF logout to be just on index.php--I'd rather be able to include it in header.tpl so I can use {logoutsmf} in my menu bar.  However, when I tried to put the same NEW information in header.php, I get a blank screen on the site, which tells me I'm either inserting it wrong or in the wrong place.

Any suggestions?


URL to your eFiction:  http://www.mickiclark.com/efiction33
Version of eFiction:  3.3.1
Have you bridged eFiction, if so with what?:  SMF
Version of PHP:
Version of MySQL: MySQL 4.1.14

 
Posted : 03/04/2008 4:07 pm
(@tammy)
Posts: 2577
Member Moderator
 

Put it in pagesetup.php.


 
Posted : 03/04/2008 8:46 pm
(@mickinell)
Posts: 62
Trusted Member
Topic starter
 

Thanks, Tammy!  I'll try that.


URL to your eFiction:  http://www.mickiclark.com/efiction33
Version of eFiction:  3.3.1
Have you bridged eFiction, if so with what?:  SMF
Version of PHP:
Version of MySQL: MySQL 4.1.14

 
Posted : 04/04/2008 9:30 am
Share: