I have a template with just text that I want to output to a specific hook location.
What php code would I use to do this?
I tried this but not sure if eval is the right thing to use here.
PHP Code:
eval('$template_hook[\'postbit_userinfo_right_after_posts\'] .= "' . fetch_template('postbit_garagelinktitle') . '";');
All I want to do is print the text "Link title" at that hook location. I'm not even sure if I need to use a template to do this or if i can just do some sort of print statement to do it.
As you can see, I'm a noob without a clue. lol
Thanks in advance for any help!
For reference, here is the complete plugin I am trying to edit...it is part of the garage mod that outputs a link to the vehicle in the postbit. I tried to put the text in the template that was created by the plugin but then it prints the "Link title" text above each vehicle if a user has more than one vehicle in the postbit.
PHP Code:
global $vbulletin;
if(THIS_SCRIPT == 'showpost' OR THIS_SCRIPT == 'showthread')
{
switch ($vbulletin->options['postbittype'])
{
case 1: $pbq = "ORDER BY `main_vehicle` DESC LIMIT 1"; break;
case 2: $pbq = "ORDER BY `main_vehicle` DESC LIMIT 1"; break;
case 3: $pbq = "ORDER BY `vehicle_id` DESC LIMIT 10"; break;
}
$sql = $this->registry->db->query("select *, " . TABLE_PREFIX . "garage_user_vehicle.user_id AS PostUser
from " . TABLE_PREFIX . "garage_user_vehicle
LEFT JOIN " .TABLE_PREFIX . "garage_makes
on (" .TABLE_PREFIX . "garage_user_vehicle.make_id=" .TABLE_PREFIX . "garage_makes.id)
LEFT JOIN " .TABLE_PREFIX . "garage_models
on (" .TABLE_PREFIX . "garage_user_vehicle.model_id=" .TABLE_PREFIX . "garage_models.id)
WHERE " . TABLE_PREFIX . "garage_user_vehicle.user_id='" . $post['userid'] ."' " . $pbq);
if($this->registry->db->num_rows($sql) > 0)
{
********THIS IS THE PART I ADDED************
eval('$template_hook[\'postbit_userinfo_right_after_posts\'] .= "' . fetch_template('postbit_garagelinktitle') . '";');
********/ THIS IS THE PART I ADDED************
if($vbulletin->options['postbittype'] >= 3)
{
print("What is in my garage");
while ($entry = $this->registry->db->fetch_array($sql))
{
$newyr = substr($entry[made_year], -2);
eval('$template_hook[\'postbit_userinfo_right_after_posts\'] .= "' . fetch_template('postbit_garagelink') . '";');
}
} else {
$entry = $this->registry->db->fetch_array($sql);
$newyr = substr($entry[made_year], -2);
eval('$template_hook[\'postbit_userinfo_right_after_posts\'] .= "' . fetch_template('postbit_garagelink') . '";');
}
}
}