Log in

View Full Version : :NEWDEFINITION:?


Tequila
03-22-2010, 07:30 PM
I am adding in a new defined code to show an extra feed (with a php include for news).

The code I have is:
function getextrafeed(){

include("config.php");

//tada, let's show some news & quick links

$extrafeed = "<table border='0' cellpadding='2' cellspacing='5'><tr><td><?php include('news.php');?></td><td><a href='adopt.php'><img src='http://i46.tinypic.com/wisp51.jpg' border='0' alt='Adopt' title='Adopt' /></a> <a href='profile.php?user=".$loggedinname."'><img src='http://i46.tinypic.com/315e4r6.jpg' border='0' alt='Your Grimoire' title='Your Grimoire' /></a> <a href='pages.php?page=donate'><img src='http://i50.tinypic.com/28ixqbs.jpg' border='0' alt='Donate' title='Donate' /></a></td></tr></table>";


return $extrafeed;

}

Now how do I get it to show in the template, I tried :EXTRAFEED: as a shortcut, but haven't got it to show yet.

http://i44.tinypic.com/i386xg.jpg

Arianna
03-23-2010, 12:34 AM
You have to add it manually to the bottom of each and every template.
I did something like it, too.
The best thing one could do is to get them all to an array (via a getStats function or whatever) and give the array to the prepare function... :P

Tequila
03-23-2010, 08:35 AM
You have to add it manually to the bottom of each and every template.
I did something like it, too.
The best thing one could do is to get them all to an array (via a getStats function or whatever) and give the array to the prepare function... :P


Meh, I'm to busy to fight with that, I'll just go about a different way... *yawn* Work sucks...

Magnie
03-23-2010, 11:54 PM
Well... you will need to replace ':EXTRAFEED:' with:

$article_content = $article_content.$extrafeed;

Otherwise you might need to put it in 'functions.php' where it loads the variable. I'm not fully sure of what you want though, sorry.

Or where you have ':EXTRAFEED:' have:

$efeed = getextrafeed()

$article_content = $article_content.$efeed

which should get the returned variable. :)

Tequila
03-24-2010, 06:48 AM
Well... you will need to replace ':EXTRAFEED:' with:

$article_content = $article_content.$extrafeed;

Otherwise you might need to put it in 'functions.php' where it loads the variable. I'm not fully sure of what you want though, sorry.

Or where you have ':EXTRAFEED:' have:

$efeed = getextrafeed()

$article_content = $article_content.$efeed

which should get the returned variable. :)


I'll try that now that I have a day off. We've been super busy for retail.