vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=245)
-   -   vBulletin Forum Sideblocks - Show Poll In Forum Sideblock (https://vborg.vbsupport.ru/showthread.php?t=266481)

Paul. 03-08-2014 05:15 PM

Is it possible for more than one poll to be displayed in the side block, or in other separate blocks?

4.2.2

MaLTRaiN 03-13-2014 12:04 AM

Quote:

Originally Posted by Paul. (Post 2485930)
Is it possible for more than one poll to be displayed in the side block, or in other separate blocks?

4.2.2

I need the same option!!!

:up:

Bob_R 04-16-2014 04:05 PM

1 Attachment(s)
Can anyone help with this alignment issue? (see screenshot)

Thanks. :)

Bob_R 04-23-2014 04:50 AM

Quote:

Originally Posted by thang28101993 (Post 2416430)
I installed Mod and it is working well, but I have a small issue with template before vote, as this image:

https://vborg.vbsupport.ru/external/2014/04/20.jpg

And after Vote thread, that issue not appear:

https://vborg.vbsupport.ru/external/2014/04/21.jpg

So how I can make for the poll before vote is not wrong and clear as after vote:

Excuse me, I'm a new fan of Vbb, and I have to learn more! So, please help me to solve that problem! Thanks in advanced.

I use Vbb 4.2.0 Pl3

Quote:

Originally Posted by Bob_R (Post 2493440)
Can anyone help with this alignment issue? (see screenshot)

Thanks. :)

Post #164 the one right above this one????

Morrus 04-24-2014 02:27 PM

Quote:

Originally Posted by Impromptu (Post 2427599)
Using 4.2.

Been using it for a while and it works for a selected forumid in my case it's id4. The reason is because it's my website I initially had polls only for my threads. However, over the last 6 months, I've noticed that other members are creating posts with legitimate polls thus I've decided to show the poll results on forumid2...unfortunately it goes blank when I show forumid2 and yes there are a lot of polls in forumid2..

strangely when I have 2,4 (ie comma) it shows a blank...like edytwinky..any issue? in the worst case scenario ill just show poll results from my threads (forumid4) but would love it to show forumid2 (ie general members)

thanks

Same problem. I see you asked this back in June 2013, and it's April 2014 now, I assume that's not getting fixed.

GPOClan 05-09-2014 05:55 PM

I want the sideblock to be only visible to members, what do I have to do?
Thanks for your help.

Best regards,
Fields

Bob_R 05-14-2014 01:24 PM

Is there an answer in our future?

thang28101993, Impromptu, and Morrus needs answers as well!!!!

M.C. 06-01-2014 09:01 PM

nope... not working even if I put one forum ID :( works only with thread IDs :(

fxdigi-cash 09-10-2014 02:34 AM

ok, spent few minutes on this and just noticed that the PHP code in the mod doesn't get filled up when installed to the vb board. when you go to your sideblock in the forum blocks manager, you can edit the poll block and find no PHP code; it is empty. That's why it won't work. I grabed the code from the xml file so anyone can use it. place it in the PHP code area in the sideblock for poll and save it. it works fine.

PHP Code:

global $vbulletin$vbphrase$db;
if (
$vbulletin->options['poll_on_sideblock_vb4']) {

if (!empty(
$vbulletin->options['poll_on_sideblock_vb4_thread'])) {
$getthread $db->query_first("SELECT threadid, pollid, forumid, open, lastpost FROM ".TABLE_PREFIX."thread where threadid = ".$vbulletin->options['poll_on_sideblock_vb4_thread']."");

}

elseif (!empty(
$vbulletin->options['poll_on_sideblock_vb4_forum']))  {

$getthread $db->query_first("SELECT forum.forumid, thread.threadid, thread.pollid, thread.forumid, thread.open, thread.lastpost FROM ".TABLE_PREFIX."forum as forum
LEFT join "
.TABLE_PREFIX."thread as thread ON thread.forumid = forum.forumid where forum.forumid IN (".$vbulletin->options['poll_on_sideblock_vb4_forum'].") ORDER BY thread.pollid DESC LIMIT 1");

}


$poll '';
if (
$getthread['pollid'])
{
    
$pollbits '';
    
$counter 1;
    
$pollid $getthread['pollid'];

    
$show['editpoll'] = iif(can_moderate($getthread['forumid'], 'caneditpoll'), truefalse);

    
// get poll info
    
$pollinfo $db->query_first_slave("
        SELECT *
        FROM " 
TABLE_PREFIX "poll
        WHERE pollid = 
$pollid
    "
);

    require_once(
DIR '/includes/class_bbcode.php');
    
$bbcode_parser = new vB_BbCodeParser($vbulletinfetch_tag_list());

    
$pollinfo['question'] = $bbcode_parser->parse(unhtmlspecialchars($pollinfo['question']), $getthread['forumid'], true);

    
$splitoptions explode('|||'$pollinfo['options']);
    
$splitoptions array_map('rtrim'$splitoptions);

    
$splitvotes explode('|||'$pollinfo['votes']);

    
$showresults 0;
    
$uservoted 0;
    
$forumperms fetch_permissions($getthread['forumid']);
    if (!(
$forumperms $vbulletin->bf_ugp_forumpermissions['canvote']))
    {
        
$nopermission 1;
    }

    if (!
$pollinfo['active'] OR !$getthread['open'] OR ($pollinfo['dateline'] + ($pollinfo['timeout'] * 86400) < TIMENOW AND $pollinfo['timeout'] != 0) OR $nopermission)
    {
        
//thread/poll is closed, ie show results no matter what
        
$showresults 1;
    }
    else
    {
        
//get userid, check if user already voted
        
$voted intval(fetch_bbarray_cookie('poll_voted'$pollid));
        if (
$voted)
        {
            
$uservoted 1;
        }
    }


    if (
$pollinfo['timeout'] AND !$showresults)
    {
        
$pollendtime vbdate($vbulletin->options['timeformat'], $pollinfo['dateline'] + ($pollinfo['timeout'] * 86400));
        
$pollenddate vbdate($vbulletin->options['dateformat'], $pollinfo['dateline'] + ($pollinfo['timeout'] * 86400));
        
$show['pollenddate'] = true;
    }
    else
    {
        
$show['pollenddate'] = false;
    }

    foreach (
$splitvotes AS $index => $value)
    {
        
$pollinfo['numbervotes'] += $value;
    }

    if (
$vbulletin->userinfo['userid'] > 0)
    {
        
$pollvotes $db->query_read_slave("
            SELECT voteoption
            FROM " 
TABLE_PREFIX "pollvote
            WHERE userid = " 
$vbulletin->userinfo['userid'] . " AND pollid = $pollid
        "
);
        if (
$db->num_rows($pollvotes) > 0)
        {
            
$uservoted 1;
        }
    }

    if (
$showresults OR $uservoted)
    {
        if (
$uservoted)
        {
            
$uservote = array();
            while (
$pollvote $db->fetch_array($pollvotes))
            {
                
$uservote["$pollvote[voteoption]"] = 1;
            }
        }
    }

    
$left vB_Template_Runtime::fetchStyleVar('left');
    
$right vB_Template_Runtime::fetchStyleVar('right');
    
$option['open'] = $left[0];
    
$option['close'] = $right[0];

    foreach (
$splitvotes AS $index => $value)
    {
        
$arrayindex $index 1;
        
$option['uservote'] = iif($uservote["$arrayindex"], truefalse);
        
$option['question'] = $bbcode_parser->parse($splitoptions["$index"], $getthread['forumid'], true);

        
// public link
        
if ($pollinfo['public'] AND $value)
        {
            
$option['votes'] = '<a href="' fetch_seo_url('poll'$pollinfo, array('do' => 'showresults')) . 
                
'">' vb_number_format($value) . '</a>';
        }
        else
        {
            
$option['votes'] = vb_number_format($value);   //get the vote count for the option
        
}

        
$option['number'] = $counter;  //number of the option

        //Now we check if the user has voted or not
        
if ($showresults OR $uservoted)
        { 
// user did vote or poll is closed

            
if ($value <= 0)
            {
                
$option['percentraw'] = 0;
            }
            else if (
$pollinfo['multiple'])
            {
                
$option['percentraw'] = ($value $pollinfo['voters']) ? $value $pollinfo['voters'] * 100 100;
            }
            else
            {
                
$option['percentraw'] = ($value $pollinfo['numbervotes']) ? $value $pollinfo['numbervotes'] * 100 100;
            }
            
$option['percent'] = vb_number_format($option['percentraw'], 2);

            
$option['graphicnumber'] = $option['number'] % 1;
            
$option['barnumber'] = round($option['percent']) * 2;
            
$option['remainder'] = 201 $option['barnumber'];

            
// Phrase parts below
            
if ($nopermission)
            {
                
$pollstatus $vbphrase['you_may_not_vote_on_this_poll'];
            }
            else if (
$showresults)
            {
                
$pollstatus $vbphrase['this_poll_is_closed'];
            }
            else if (
$uservoted)
            {
                
$pollstatus $vbphrase['you_have_already_voted_on_this_poll'];
            }


            
$templater vB_Template::create('sideblock_pollresult');
                
$templater->register('names'$names);
                
$templater->register('option'$option);
            
$pollbits .= $templater->render();
        }
        else
        {

            if (
$pollinfo['multiple'])
            {
                
$templater vB_Template::create('sideblock_polloption_multiple');
                    
$templater->register('option'$option);
                
$pollbits .= $templater->render();
            }
            else
            {
                
$templater vB_Template::create('sideblock_polloption');
                    
$templater->register('option'$option);
                
$pollbits .= $templater->render();
            }
        }
        
$counter++;
    }

    if (
$pollinfo['multiple'])
    {
        
$pollinfo['numbervotes'] = $pollinfo['voters'];
        
$show['multiple'] = true;
    }

    if (
$pollinfo['public'])
    {
        
$show['publicwarning'] = true;
    }
    else
    {
        
$show['publicwarning'] = false;
    }

    
$displayed_dateline $getthread['lastpost'];
    
$pollinfo['threadid'] = $getthread['threadid'];

    if (
$showresults OR $uservoted)
    {
        
$templater vB_Template::create('sideblock_pollresults_table');
            
$templater->register('pollbits'$pollbits);
            
$templater->register('pollenddate'$pollenddate);
            
$templater->register('pollendtime'$pollendtime);
                        
$templater->register('pollinfo'$pollinfo);
                        
$templater->register('show'$show);
            
$templater->register('pollstatus'$pollstatus);
        
$poll $templater->render();
    }
    else
    {
        
$templater vB_Template::create('sideblock_polloptions_table');
            
$templater->register('pollbits'$pollbits);
            
$templater->register('pollenddate'$pollenddate);
            
$templater->register('pollendtime'$pollendtime);
                        
$templater->register('show'$show);
            
$templater->register('pollinfo'$pollinfo);
        
$poll $templater->render();
    }
    
return 
$poll;

}
}
else {



Mohammad Kamal 04-03-2017 05:27 AM

How can I show more than one poll?

oldfan 04-08-2023 12:02 AM

dont work 4.2.5. php 7.2


All times are GMT. The time now is 12:58 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.02598 seconds
  • Memory Usage 1,884KB
  • 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_php_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (11)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