vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   adding printable thread button in the sidebar (https://vborg.vbsupport.ru/showthread.php?t=317426)

fxdigi-cash 02-20-2015 04:33 AM

adding printable thread button in the sidebar
 
Hi all,

I want to remove the popup menu above the threads and planning to put them on the sidebar on the same thread page where a user can push the printable version button as it is easy to see aside.

I took this code from Showthread template and tried to set it up on the sidebar, but it doesn't pick the thread number!!

HTML Code:

<a href="{vb:raw $vboptions.vbforum_url}{vb:if "$vboptions['vbforum_url']", '/', ''}printthread.php?{vb:raw session.sessionurl}t={vb:raw threadid}&amp;pp={vb:raw perpage}&amp;page={vb:raw pagenumber}" accesskey="3" rel="nofollow">{vb:rawphrase show_printable_version}</a>
what is the right way to do that?

Thanks

kh99 02-20-2015 10:03 AM

How are you doing that exactly? If you're using a template, you would need to register the threadid and pagenumber values to the template before rendering it (and remove the $ from vboptions the first time it appears).

fxdigi-cash 02-20-2015 11:03 AM

Quote:

Originally Posted by kh99 (Post 2538077)
How are you doing that exactly? If you're using a template, you would need to register the threadid and pagenumber values to the template before rendering it (and remove the $ from vboptions the first time it appears).

I'm not really sure how, but I know for sure it is possible to do so...

how do I register the threadid and pagenumber values? do I have to use a plugin or write a php code?
any clue on that??

by the way, the printable version button is going to be on the same page where it is used to be except that I will move it to the sidebar that appears on the same page as showthread

Thanks

kh99 02-20-2015 11:30 AM

So when you say you're moving it to the sidebar, do you mean you're creating a forum block? Then you'd need a php type forum block that renders a template.

Well, OK, you could just code the html into your php wihout a template, and it might be a little easier to code. The convention is to use templates for html, but you don't have to follow that.

fxdigi-cash 02-20-2015 11:38 AM

Quote:

Originally Posted by kh99 (Post 2538087)
So when you say you're moving it to the sidebar, do you mean you're creating a forum block? Then you'd need a php type forum block that renders a template.

Well, OK, you could just code the html into your php wihout a template, and it might be a little easier to code. The convention is to use templates for html, but you don't have to follow that.

ok, good to know. However, I still don't know how to start this. I mean I don't know any php code that replaces the one I posted in the first post. also, I have no idea what template for html to use??

can you give some example please!

Thanks

kh99 02-20-2015 12:15 PM

Hmm...Well, the sidebar only shows up on the forum home page, so I don't understand how it's going to let you print a thread.

fxdigi-cash 02-20-2015 01:47 PM

Quote:

Originally Posted by kh99 (Post 2538096)
Hmm...Well, the sidebar only shows up on the forum home page, so I don't understand how it's going to let you print a thread.

not really, it is a customized sidebar I made by dividing the showthread page. you can see it here:

http://www.forexmegacashback.com/sho...0440#post30440

I want to show the print thread on the left side where you can see the sidebar under the menu


All times are GMT. The time now is 07:55 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.01413 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
  • (1)bbcode_html_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)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