vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   edit template (https://vborg.vbsupport.ru/showthread.php?t=324766)

Milobil 03-18-2017 10:19 PM

edit template
 
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:

PHP 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 :

Code:

<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

Dave 03-19-2017 01:30 PM

Move the onclick event to the hyperlink itself.
Something like:

PHP Code:

<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!!!!!


All times are GMT. The time now is 08:41 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.02381 seconds
  • Memory Usage 1,722KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (2)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete