vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   [SOLVED]Pulling threadid in templates (https://vborg.vbsupport.ru/showthread.php?t=328365)

shka 11-25-2020 12:03 PM

one post above

Code:

{vb:raw threadinfo.threadid}

Dr.CustUmz 11-25-2020 12:43 PM

Makes the link
Code:

refresh.php?do=newthread&t={vb:raw%20threadinfo.threadid}
and if used as a variable displays nothing... did you see the way Im trying to add it in the product?

--------------- Added [DATE]1606315573[/DATE] at [TIME]1606315573[/TIME] ---------------

PHP Code:

$new_thread_link '<div><a href="refresh.php?'.$sessionurl.'do=newthread&amp;t='.{vb:raw threadinfo.threadid}.'" rel="nofollow" class="newcontent_textcontrol" id="newthreadlink_top" style="margin-left:10px;"><span>+</span> '.$post_phrase.'</a></div>';

    
$find '<div id="pagination_top"';
    
$replace $new_thread_link.$find;
    
$vbulletin->templatecache['SHOWTHREAD'] = str_replace($find$replace$vbulletin->templatecache['SHOWTHREAD']); 


shka 11-25-2020 02:58 PM

One option - you build your link on plugin level. Than you have to choose a hook, when $threadinfo already exists. Example with "showthread_complete"

Code:

    <plugin active="1" executionorder="5">
                        <title>Button Plus</title>
                        <hookname>showthread_complete</hookname>
                        <phpcode><![CDATA[if (THIS_SCRIPT == 'showthread'){
$threadidid = $threadinfo['threadid'];
$new_thread_link = '<div><a href="refresh.php?'.$sessionurl.'do=newthread&amp;t='.$threadidid.'" rel="nofollow" class="newcontent_textcontrol" id="newthreadlink_top" style="margin-left:10px;"><span>+</span> '.$post_phrase.'</a></div>';

    $find = '<div id="pagination_top"';
    $replace = $new_thread_link.$find;
    $vbulletin->templatecache['SHOWTHREAD'] = str_replace($find, $replace, $vbulletin->templatecache['SHOWTHREAD']);
}]]></phpcode>
                </plugin>


Dr.CustUmz 11-25-2020 03:25 PM

Thank you for all your help. I need to learn this vb4 crap (its about 10 years too late lol) vb3 is so much easier.


All times are GMT. The time now is 12:56 PM.

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.00985 seconds
  • Memory Usage 1,725KB
  • 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
  • (3)bbcode_code_printable
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete