Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 Programming Discussions
Register FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 12-09-2009, 08:13 PM
lms lms is offline
 
Join Date: Jan 2008
Posts: 34
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Itsid HIDE ajax sids hide. Don't work AJAX. Help

Hola:
Estoy adaptando el c?digo de Itsid HIDE ajax sids hide (no aparece por esta web desde hace m?s de un a?o -Developer Last Online: Aug 2008- y no logro contactar con ?l) y lo he hecho funcionar en la BETA 3 de vB pero no logro que funcione la parte AJAX. En particular este reemplazo
PHP Code:
            <title>JS_PLACEMENT by Ziki</title>
            <hookname>global_start</hookname>
            <phpcode><![CDATA[if ($vbulletin->options['sid_hide_ajax_on'] AND THIS_SCRIPT === showthread){            
                $ara = '<!-- / CSS Stylesheet -->';
                $vbulletin->templatecache['HEADINCLUDE'] = str_replace($ara,$ara . vB_Template::fetch_template_raw('sid_hide_head'),$vbulletin->templatecache['HEADINCLUDE']);
            }]]></phpcode> 
La variable
PHP Code:
$ara = '<!-- / CSS Stylesheet -->'; 
no funciona y hace que no funcione el mod en su parte AJAX.

Esto no s? si funciona bien:
PHP Code:
        </plugin>
        <plugin active="1" executionorder="126">
            <title>hide hack ajax request</title>
            <hookname>postbit_display_complete</hookname>
            <phpcode><![CDATA[
            if ($_REQUEST['do'] == 'whatever'){
            global $vbulletin, $vboptions, $bbuserinfo, $db, $threadid, $postid;
            $bbuserinfo = $this->registry->userinfo;
            $postid = $_REQUEST['p'];
            $hide_call = $_REQUEST['all'];
            $hide_read = false;
            $hide_replied = '';
            $hide_thanked = '';
            if ($vbulletin->options['sid_hide_showthanked']){
                if($vbulletin->options['post_thanks_forum_first_all'] == 1){
                    $hide_thanked = $db->query_first("SELECT userid FROM ". TABLE_PREFIX ."post_thanks WHERE postid='$thread[firstpostid]' AND userid='$bbuserinfo[userid]'");
                    if($hide_thanked !=''){
                        $hide_read = true;
                    }
                } elseif (!empty($vbulletin->options['post_thanks_forum_first'])){
                    $post_thanks_forums1_first = explode("|",$vbulletin->options['post_thanks_forum_first']);
                    if (in_array($this->thread['forumid'], $post_thanks_forums1_first)){
                        $hide_thanked = $db->query_first("SELECT userid FROM ". TABLE_PREFIX ."post_thanks WHERE postid='$thread[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='$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='$postid' AND userid='$bbuserinfo[userid]'");
                    if($hide_thanked !=''){
                        $hide_read = true;
                    }
                }
            }
            if ($vbulletin->options['sid_hide_showposted'] AND $hide_read==false){
                $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 = true;
                }
            }
            if(!$bbuserinfo[userid]){
                $hide_read = false;
            }
            if( $hide_read == true){
                $hide_post = $db->query_first("SELECT pagetext as 'message' FROM ". TABLE_PREFIX ."post WHERE postid='$postid'");
                $hide_string = "#\[hide\](.*)\[\/hide\]#siU";
                require_once(DIR . '/includes/class_bbcode.php');
                $parser =& new vB_BbCodeParser($vbulletin, fetch_tag_list());
                $hide_post['message'] = $parser->do_parse($hide_post['message'],true);
                if(preg_match_all($hide_string, $hide_post['message'], $hide_match)) {
                    for($i=0; $i<count($hide_match[0]); $i++) {
                        $hide_replace[$i] ="<fieldset><legend><span class=\"highlight\">".$vbphrase[sid_hide_post_show]."</span></legend>".$hide_match[1][$i]."</fieldset>";
                        $hide_post['message']= str_replace($hide_match[0][$i],$hide_replace[$i],$hide_post['message']);
                    }
                }
            }else{
                $hide_post['message'] = 'sid_hide_still_active';
            }
            
            $ajax_on = true;
            $output = $hide_post['message'];
            echo "$output";
            exit;
            }
            ]]></phpcode> 
?Algui?n puede echarme una mano?

Perd?n por mi mal ingl?s, pero soy espa?ol y uso traductor.

---------------------------------------------------------------------------------------------------

Hello:
I am adapting the code of Itsid (does not appear by this site from more than a year -Developer Last Online: Aug 2008- and not achieving contact with him) HIDE ajax sids hide and i have done work in the BETA 3 vB but not achievement to operate the party AJAX. In particular this replacement
PHP Code:
            <title>JS_PLACEMENT by Ziki</title>
            <hookname>global_start</hookname>
            <phpcode><![CDATA[if ($vbulletin->options['sid_hide_ajax_on'] AND THIS_SCRIPT === showthread){            
                $ara = '<!-- / CSS Stylesheet -->';
                $vbulletin->templatecache['HEADINCLUDE'] = str_replace($ara,$ara . vB_Template::fetch_template_raw('sid_hide_head'),$vbulletin->templatecache['HEADINCLUDE']);
            }]]></phpcode> 
variable
PHP Code:
$ara = '<!-- / CSS Stylesheet -->'; 
does not work and does not work the mod in its part AJAX.

This does not know if it works well:
PHP Code:
        </plugin>
        <plugin active="1" executionorder="126">
            <title>hide hack ajax request</title>
            <hookname>postbit_display_complete</hookname>
            <phpcode><![CDATA[
            if ($_REQUEST['do'] == 'whatever'){
            global $vbulletin, $vboptions, $bbuserinfo, $db, $threadid, $postid;
            $bbuserinfo = $this->registry->userinfo;
            $postid = $_REQUEST['p'];
            $hide_call = $_REQUEST['all'];
            $hide_read = false;
            $hide_replied = '';
            $hide_thanked = '';
            if ($vbulletin->options['sid_hide_showthanked']){
                if($vbulletin->options['post_thanks_forum_first_all'] == 1){
                    $hide_thanked = $db->query_first("SELECT userid FROM ". TABLE_PREFIX ."post_thanks WHERE postid='$thread[firstpostid]' AND userid='$bbuserinfo[userid]'");
                    if($hide_thanked !=''){
                        $hide_read = true;
                    }
                } elseif (!empty($vbulletin->options['post_thanks_forum_first'])){
                    $post_thanks_forums1_first = explode("|",$vbulletin->options['post_thanks_forum_first']);
                    if (in_array($this->thread['forumid'], $post_thanks_forums1_first)){
                        $hide_thanked = $db->query_first("SELECT userid FROM ". TABLE_PREFIX ."post_thanks WHERE postid='$thread[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='$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='$postid' AND userid='$bbuserinfo[userid]'");
                    if($hide_thanked !=''){
                        $hide_read = true;
                    }
                }
            }
            if ($vbulletin->options['sid_hide_showposted'] AND $hide_read==false){
                $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 = true;
                }
            }
            if(!$bbuserinfo[userid]){
                $hide_read = false;
            }
            if( $hide_read == true){
                $hide_post = $db->query_first("SELECT pagetext as 'message' FROM ". TABLE_PREFIX ."post WHERE postid='$postid'");
                $hide_string = "#\[hide\](.*)\[\/hide\]#siU";
                require_once(DIR . '/includes/class_bbcode.php');
                $parser =& new vB_BbCodeParser($vbulletin, fetch_tag_list());
                $hide_post['message'] = $parser->do_parse($hide_post['message'],true);
                if(preg_match_all($hide_string, $hide_post['message'], $hide_match)) {
                    for($i=0; $i<count($hide_match[0]); $i++) {
                        $hide_replace[$i] ="<fieldset><legend><span class=\"highlight\">".$vbphrase[sid_hide_post_show]."</span></legend>".$hide_match[1][$i]."</fieldset>";
                        $hide_post['message']= str_replace($hide_match[0][$i],$hide_replace[$i],$hide_post['message']);
                    }
                }
            }else{
                $hide_post['message'] = 'sid_hide_still_active';
            }
            
            $ajax_on = true;
            $output = $hide_post['message'];
            echo "$output";
            exit;
            }
            ]]></phpcode> 
How someone can i a hand?

Forgiveness for my bad english, but i am spanish and use translator.


Salud2
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 04:10 PM.


Powered by vBulletin® Version 3.9.0
Copyright ©2000 - 2017, vBulletin Solutions Inc.