vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.6 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=194)
-   -   New Posting Features - [hide] hack incl post thank you "addon" (https://vborg.vbsupport.ru/showthread.php?t=130887)

itsid 12-29-2006 10:43 PM

Would you do me a favour and try a clean install without any part of existing database?
then install post_thanks and hide and check again?

'sid

ps I'll try to build up a new plugin for testing purpose to see where it messes up with vbulletin, that'll take a while

stinger2 12-30-2006 09:17 AM

that is already done sid........with a clean install of vbulletin your hack works perfectly good.
no problem what so ever....so it has to be some code left over from something in the past in my database,,,,,,and i dont have a clue where and how to find it...i will setup a test board some where so you and i can investigate it

thanks again

itsid 12-31-2006 12:38 AM

stinger...
as you say that again...
Did you checked your plugin manager? and took a VERY CLOSE look ?
Maybe the "ugly" Plugin is just a plugin and no product, and maybe it's listed as a vbulletin plugin because there is no corresponding product.
And/Or did you also checked the plugin-table directly in your database?
(take a screenshot of your pluginmanager if you are unsure)
I'll go and find the sources of those plugins then ;)

'sid

PS My extra plugin is still as buggy as it is overloaded ;)

stinger2 12-31-2006 04:25 PM

n0p..nothing else

http://www.hostmypiconline.com/images/hed.jpg

http://www.hostmypiconline.com/images/hed2.jpg


http://www.hostmypiconline.com/images/hed3.jpg

http://www.hostmypiconline.com/images/hed4.jpg

itsid 01-02-2007 02:33 AM

Hi there,
got a small debug plugin to work now (see attachement)

infact it is less debugging but more a "show the variables" plugin :classic:

Import it as a plugin
AND
disable the fetch hide tag plugin (don't forget!)

Output of that plugin is only visible to usergroupid 6 (admins)

Now, go to your forums and thank or reply to any hidden content
(best not in firstpost and not one of your own postings)

Copy&paste output into this thread. (this thread is linked inside the plugin ;))

Right afterwards enable the fetch hide tag plugin and disable or delete the debug plugin (three additional databasequerys)

'sid

PS This plugin is ONLY if you have installed Abe1s Post_Thanks Hack, without that you'll get db-errors!!

stinger2 01-02-2007 03:18 PM

this is the info i get sid.....dont know if any thing is wrong ...

but yesterday something did get my attention .....when i chose (disable ajax features)......when i chose...disable problematic ajax feature....the hide hack does not work anymore..........

so logicaly...it means that my board has some ajax problem.....dont know how to check it or correct it though..i am investigating now....

here is the debug info

regards
S2

Quote:

hide-hack DEBUG Information only visible to adminsglobal information
This Script :showthread
Post userid :2433
Own userid :2
Forumid :102
First postid :139711
thanked first post : NOPE
This postid :139711
thanked this post : NOPE
Replied to this thread : NOPE
hide options
This Script :showthread
Active :1
AJAX :1
Not in forums :
Show admins :0
Show mods :0
Show usergroups :
Show thanked :1
Show posted :1
thank options
Only first (all) :0
Only first (seperate) :
Thank array userid:1649
Thanks array userid :1649

itsid 01-02-2007 03:53 PM

hi stinger..
Quote:

First postid :139711
thanked first post : NOPE
This postid :139711
thanked this post : NOPE
Replied to this thread : NOPE
You have to thank a post to let me get where I want to
If you do nothing, the hack wont do anything and no error occurs,
Sorry should have told you: this has to be within a "should be unhidden content" post but still is hidden

go ahead, try again :D

'sid

about the disable problematic ajax functions:
The hack does not need any ajax at all, but without you'll have to relaod the page to see what's hidden (as in early versions) on the other hand that's exactly where your error is around.
And yes; if ajax isn't fully enabled the hide-hack disables it's own ajax features as well.

stinger2 01-02-2007 05:09 PM

sorry sid....it was taken after i removed the thank you and refreshed to see what happens...

this is it

BTW.....the reply to see the hidden content option is working fine....the hidden content becomes unhidden..and remains unhidden with refresh...or when you go somewhere else and come back.....is there any difference between the two ???


Code:

hide-hack DEBUG Information only visible to adminsglobal information
This Script :showthread
Post userid :2433
Own userid :2
Forumid :102
First postid :139711
thanked first post : YES
This postid :139711
thanked this post : YES
Replied to this thread : NOPE
hide options
This Script :showthread
Active :1
AJAX :1
Not in forums :
Show admins :0
Show mods :0
Show usergroups :
Show thanked :1
Show posted :1
thank options
Only first (all) :0
Only first (seperate) :
Thank array userid:1649
Thanks array userid :1649


itsid 01-02-2007 10:13 PM

Yes it is.. a huge difference :D
if you thanked this hack won't do a db query if you (as you have it) can thank each post and not only the first one.
but in your case that won't do somehow.
so replace your fetch hide tag plugin by this code:
PHP Code:

if ($this->registry->options['sid_hide_active'] == '1' AND stristr($post['message'],'[hide]')){
            global 
$vbulletin$vboptions$bbuserinfo$db$threadid$hide_call$postid;
            
$bbuserinfo $this->registry->userinfo;
            
$post $this->post;
            
$hide_read false;
            
$hide_img_set 0;
            
$hide_replied '';
            
$hide_thanked '';
            
$hide_stop 0;
            if (!empty(
$this->registry->options['sid_hide_notforum'])){
                
$sid_hide_forum_stop explode(",",$this->registry->options['sid_hide_notforum']);
                if(
in_array($thread['forumid'],$sid_hide_forum_stop)){
                    
$post['message'] = preg_replace('/\\[hide\\](.*)\\[\/hide\\]/siU''\\1'$post['message']);
                    
$hide_stop 1;
                }
            }
            if(
$post['userid'] == $bbuserinfo['userid'] AND $hide_stop == 0){
                
$post['message'] = preg_replace('/\\[hide\\](.*)\\[\/hide\\]/siU''<fieldset><legend><span class="highlight">'.$vbphrase[sid_hide_post_own].'</span></legend>\\1</fieldset>'$post['message']);
                
$hide_stop 1;
            }
            if (
$hide_stop != 1){
                if (
$this->registry->options['sid_hide_showadmin'] AND $bbuserinfo[usergroupid]==6){
                    
$hide_read true;
                }elseif (
$this->registry->options['sid_hide_showmod'] AND can_moderate($thread['forumid'])){
                    
$hide_read true;
                }elseif (!empty(
$this->registry->options['sid_hide_showusergroup'])){
                    
$hide_groups_see explode(",",$this->registry->options['sid_hide_showusergroup']);
                    if (
in_array($bbuserinfo['usergroupid'], $hide_groups_see)){
                        
$hide_read true;
                    }
                }
                if (
$vbulletin->options['sid_hide_showthanked'] AND $hide_read==false){
                    
$hide_img_set $hide_img_set 1;
                    if(
$vbulletin->options['post_thanks_forum_first_all'] == 1){
                        
$hide_thanked $db->query_first("SELECT userid FROM "TABLE_PREFIX ."post_thanks WHERE postid='$threadinfo[firstpostid]' AND userid='$bbuserinfo[userid]'");
                        if(
$hide_thanked !=''){
                            
$hide_read true;
                        }
                    } elseif (!empty(
$vbulletin->options['post_thanks_forum_first'])){
                        
$post_thanks_only_first explode("|",$vbulletin->options['post_thanks_forum_first']);
                        if (
in_array($threadinfo['forumid'], $post_thanks_only_first)){
                            
$hide_thanked $db->query_first("SELECT userid FROM "TABLE_PREFIX ."post_thanks WHERE postid='$threadinfo[firstpostid]' AND userid='$bbuserinfo[userid]'");
                            if(
$hide_thanked !=''){
                                
$hide_read true;
                            }
                        }else{
                            
$hide_thanked $db->query_first("SELECT userid FROM "TABLE_PREFIX ."post_thanks WHERE postid='$post[postid]' AND userid='$bbuserinfo[userid]'");
                            if(
$hide_thanked !=''){
                                
$hide_read true;
                            }
                        }
                    } else{
                        
$hide_thanked $db->query_first("SELECT userid FROM "TABLE_PREFIX ."post_thanks WHERE postid='$post[postid]' AND userid='$bbuserinfo[userid]'");
                        if(
$hide_thanked !=''){
                            
$hide_read true;
                        }
                    }
                }
                if (
$this->registry->options['sid_hide_showposted'] AND $hide_read==false){
                    
$hide_img_set $hide_img_set ;
                    
$hide_replied $db->query("SELECT COUNT(postid) AS count FROM "TABLE_PREFIX "post WHERE userid='$bbuserinfo[userid]' AND visible = 1 AND threadid='$post[threadid]'");
                    
$myreplies 0;
                    if(
$db->num_rows($hide_replied)){
                        while (
$h_post $db->fetch_array($hide_replied)){
                            
$myreplies += $h_post['count'];
                        }
                        
$myreplies vb_number_format($myreplies);
                    }
                    if(
$myreplies 0){
                        
$hide_read['userid'] = true;
                    }
                }
                if (!
$hide_call){
                    
$hide_call =$post['postid'];
                } else {
                    
$hide_call .=",".$post['postid'];
                }
                if(
$hide_img_set == 3){
                    
$hide_img $vbphrase[sid_hide_img_pot];
                } elseif (
$hide_img_set == 2){
                    
$hide_img $vbphrase[sid_hide_img_post];
                } elseif (
$hide_img_set == 1){
                    
$hide_img $vbphrase[sid_hide_img_thank];
                } else {
                    
$hide_img $vbphrase[sid_hide_img_sorry];
                }
                if(!
$bbuserinfo[userid]){
                    
$hide_read false;
                }
                if (
$hide_read == true){
                    
$post['message'] = preg_replace('/\\[hide\\](.*)\\[\/hide\\]/siU''<fieldset><legend><span class="highlight">'.$vbphrase[sid_hide_post_show].'</span></legend>\\1</fieldset>'$post['message']);
                } else {
                    eval(
'$hide_fetch = "' fetch_template('sid_hide_noaccess') . '";');
                    
$post['message'] = preg_replace('/\\[hide\\](.*)\\[\/hide\\]/siU'$hide_fetch$post['message']);
                }
            }
        } 

that'll add an own db query for thanked posts and is not using the original array.

This one will surely work.

(I hat to have unnecessary querys, but I see no other chance right now to get this to work in your forums.)

'sid

ps don't forget to delete the debug plugin! that's causing a lot of querys too :D

stinger2 01-03-2007 12:30 AM

what a genius solution sid........looked at the change you made.......and you know what..its working like a charm now.....;)

thanks for all your help and sorry for all the troubles i made...:cool:


All times are GMT. The time now is 08:36 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.02508 seconds
  • Memory Usage 1,847KB
  • 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
  • (1)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (3)pagenav_pagelinkrel
  • (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