vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   show newthread or newreply button in hack (https://vborg.vbsupport.ru/showthread.php?t=184528)

almannai 07-06-2008 05:44 PM

show newthread or newreply button in hack
 
Hi,

I have this situation where the hack need to check if the user can post new thread or new reply depending on the displayed page. So on forums page the new thread button will be shown and on the thread page the new reply button will be show. With forcing the permissions of the forum or the user. Like if the forums does not allow post the new thread button shouldn't be displayed.

like this code in a plugin

if(allow new post)// What it should be written here-the condition
{
//do this
}else if (allow new reply)// What it should be written here
{
//do other thing
}

Regards,

Dismounted 07-07-2008 06:13 AM

Where are you hooking your plugin?

almannai 07-07-2008 06:20 AM

Quote:

Originally Posted by Dismounted (Post 1568804)
Where are you hooking your plugin?

global_start

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

Anybody?

Also why plugin programming is poorly documented.

I looked at plugin system documentation and nothing there.

Programmer need to know variables list used by vbullettin like a list of $show variable and what each one will be used for.

Articles defiantly not enough, but sure it will help a bit.

Am' I the only one who is facing this problem, or this is a known issue by the rest!!!

Regards,

almannai 07-11-2008 03:46 PM

First I would like to thank everybody have read this thread and Dismounted for his post.

I've decided to use the following for newthread and newreply in my hack template but still not working
<if condition="$show['newthreadlink']">
<if condition="$show['largereplybutton']">

but the following are working
<if condition="$show['searchbuttons']">
<if condition="$show['registerbutton']">

can anybosy explain why?

Dismounted 07-12-2008 05:51 AM

Most likely, those variables are not set. Look in the vBulletin files to find where they are set. (A mass search tool would be useful.)

almannai 07-15-2008 07:25 AM

Quote:

Originally Posted by Dismounted (Post 1573328)
Most likely, those variables are not set. Look in the vBulletin files to find where they are set. (A mass search tool would be useful.)

Thank you Dismounted for your follow-ups.

The
<if condition="$show['newthreadlink']">
<if condition="$show['largereplybutton']">

Are taken directly from forumdisplay template and showthread template and they are working on my forum but not on the hack.

Anyway now 'am using
<if condition="THIS_SCRIPT == 'forumdisplay'">
I know this is not the best choice but this is the only working one.

Once I post the hack I will inform you here to have a look at it.

Regards,

almannai 07-17-2008 01:11 PM

Here is the hack
https://vborg.vbsupport.ru/showthread.php?t=185403
that
<if condition="$show['newthreadlink']">
<if condition="$show['largereplybutton']">

was not working in it

Dismounted 07-18-2008 07:04 AM

If you are having problems with a modification, please contact the author or post in the modification thread for help.

almannai 07-18-2008 08:53 AM

Quote:

Originally Posted by Dismounted (Post 1578234)
If you are having problems with a modification, please contact the author or post in the modification thread for help.

I'm the auther of that hack..:)

That's why am asking why that two conditions are not working were they should.

Dismounted 07-18-2008 09:06 AM

Again - check if the variable exists where you're using it.


All times are GMT. The time now is 10:24 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.01191 seconds
  • Memory Usage 1,736KB
  • 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_quote_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
  • (10)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