PDA

View Full Version : PHP File / Template


Uniphix
05-02-2006, 10:21 PM
Hello there,

I am trying to do something to save me from creating hundreds upon hundreds of "on site pages" and just use templates :) if you know what i mean...

I am currently trying to create a global function to grab things from arrays that have information I need...

Example::

$rsql = "SELECT r.name, r.description, r.index, r.str, r.strcap, r.dex, r.dexcap, r.int, r.intcap, r.classes, r.image FROM " . TABLE_PREFIX . "races AS r";

$rresult = $vbulletin->db->query($rsql);

$raceinfo = $vbulletin->db->fetch_array($rresult);


so inside the templates I can do something like this


<if conditon="$raceinfo[name]==$pagetitle">

//do my stuff here, where I can get all the values based on the Race Name to == the same as the $pagetitle from the vba's page title...

</if>



My problem is I cannot seem to get this to work how can I get this to be globaly to every page I create that will use that template that way I don't need to add 50 templates for 50 races, and just have it display all the info based on the $pagetitle to == the $raceinfo[name]...

Uniphix
05-03-2006, 06:47 PM
OKay i got everything to work except one last thing...

I am trying to make it target a template "from the php file" that all my pages will target for this system...

<?php

error_reporting(E_ALL & ~E_NOTICE);

define('THIS_SCRIPT', 'eopinfo');

$forumpath = '/home/httpd/vhosts/paragonix.org/httpdocs/forums';

if (!is_dir($forumpath))
{
echo 'Invalid forum path specified! Please edit this file and be sure to include the correct path for your $forumpath variable.';
exit;
}

chdir($forumpath);

$raceinfo = unserialize($vbulletin->eop_system_raceinfo);
$classinfo = unserialize($vbulletin->eop_system_classinfo);

//echo 'HEY';

eval('$home[$mods[\'modid\']][\'content\'] = "' . fetch_template('EOPINFO') . '";');
?>

IF i we're to uncomment the //echo 'HEY';

I am able to see it on this...

http://www.paragonix.org/index.php?eop=portal?races?Aegyptos

otherwise I can't...

I am trying to target the EOPINFO template from the templates, so I can display everything inside there...
such as

$raceinfo[name];
$raceinfo[description];

etc.

I created a AdminCP system so I can add new races, classes fast and easy thanks to the AdminCP of vba :) it helped me be able to design it the way I wanted it to be...

Although i am stuck at the very last part

Our Sponsors
 

Uniphix
05-04-2006, 04:23 AM
Well i decided to just to add a Module, then have it be assigned to the eopinfo.php page, then add other adv_portal_info type pages for that script, it turned out quite well...

Now i got over 20+ pages, did it all in today and all under an hour just due to my 3 day modifications, i'll be able to add more stuff later :) faster and eaiser since i know what i need to do to make my code work correctly

example of what i did...

http://paragonix.org/index.php?eop=races?viewraces