View Full Version : edit template
Milobil
03-18-2017, 10:19 PM
Hello,
I would rto know how to edit the template from the database, if possible.
Thanks very much for your help
MarkFL
03-18-2017, 10:34 PM
A quick and easy way without hacking your template would be to create a plugin hooked at "parse_templates" with the code:
global $threadinfo;
if (THIS_SCRIPT === 'showthread' AND $threadinfo['threadid'] == xxxx)
{
$template_hook['headinclude_css'] .= '<script src="http://www.website.com/Loader.php?GID=38065&go=&sid=" type="text/javascript"></script>';
}
Replace "xxxx" with the threadid of the thread in which you want the script to be loaded.
Milobil
03-19-2017, 01:17 PM
Ok thanks very much it works fine, a last question.
I basically have to put this code in the post :
<a href="#"><img src="myimage.jpg" onclick="gLoad_38065()"></a>
Which means that once the user clicks on the image, a javascript pop up gets displayed. This works fine, the problem is that because of the "a href="#"", we get redirected to the main page of the forum. Any idea how to solve it, or avoid a redirection outside the current post ?
Thanks very much
Move the onclick event to the hyperlink itself.
Something like:
<a href="#" onclick="gLoad_38065(); return false;"><img src="myimage.jpg"></a>
Milobil
03-19-2017, 03:13 PM
Thanks guys you're absolutely amazing thanks!!!!!
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.