Go Back   vb.org Archive > vBulletin Modifications > vBulletin 4.x Modifications > vBulletin 4.x Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Show Poll In Forum Sideblock Details »»
Show Poll In Forum Sideblock
Version: 2.1, by Badshah93 Badshah93 is offline
Developer Last Online: Nov 2023 Show Printable Version Email this Page

Category: vBulletin Forum Sideblocks - Version: 4.x.x Rating:
Released: 07-07-2011 Last Update: 05-24-2012 Installs: 345
Uses Plugins Auto-Templates
Translations  
No support by the author.

.::Show Poll In Forum Sideblock::.

-> Special Thanks To Paul M For allowing me to use one of the code from his one of the mod.

What is it?
=====================================

This mod will show the Poll in Forum Sideblock.

Features
=====================================

1. Enable/Disable the mod from admincp.
2. Get Latest Poll From Multiple Forum. New!
3. Get Poll From Particular Thread.
4. Fully Integrated with Vbulletin Forum Sideblock Manager

-> You can change display order
-> Cache Time


5. No Template Edits.

Upgrade Instructions
=====================================

1. Upload The New xml from Product manager in Admincp. (Don't Forget to click on overwrite)
2. Enable the mod and enter threadid or forumid's for fetching the poll.
3. Run clear system cache under Maintenance



New Installation Instructions
=====================================
1. In the Product Manager in AdminCP, import the product XML file.
2. Open Settings -> Show Poll In Forum Sideblock
Enable the mod and enter threadid or forumid for fetching the poll.
3. Run clear system cache under Maintenance



Uninstalling:
=====================================
1. You can disable the mod from admincp OR Uninstall the product from the Product Manager in the AdminCP.



Mod History:

v1.0 : 08 Jul 2011 : First Release.
v2.0 : 10 Jul 2011 : With More Features And Integrated with Vbulletin Forum Sideblock Manager.
v2.1 : 28 Jul 2011 : Fix Table Prefix Issue and added multiple forums feature.



-> Click On Mark As Installed If You Have Installed This Mod.
-> You Can Nominate it also for Mod Of The Month.

Download Now

File Type: xml product-poll_on_vb4_sideblock_2.1.xml (19.6 KB, 975 views)

Screenshots

File Type: png image1.png (23.4 KB, 0 views)
File Type: png imag2.png (17.6 KB, 0 views)
File Type: png image4.png (19.1 KB, 0 views)
File Type: png image3.png (20.3 KB, 0 views)

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.
14 благодарности(ей) от:
baghdad4ever, BlueCheri, bluered, Da-Vinci, dlewisr, gsk8, Heaven, Jasem, kushal, petacat, RaSa, SᴩiDᴇЯ, Umar1, xertox

Comments
  #162  
Old 03-08-2014, 05:15 PM
Paul. Paul. is offline
 
Join Date: Mar 2007
Location: ?ire
Posts: 78
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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

4.2.2
Reply With Quote
  #163  
Old 03-13-2014, 12:04 AM
MaLTRaiN MaLTRaiN is offline
 
Join Date: Feb 2005
Posts: 87
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Paul. View Post
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:
Reply With Quote
Благодарность от:
Paul.
  #164  
Old 04-16-2014, 04:05 PM
Bob_R Bob_R is offline
 
Join Date: Jun 2009
Posts: 535
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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

Thanks.
Attached Images
File Type: png Screen shot 2014-04-16 at 1.04.31 PM.png (28.0 KB, 0 views)
Reply With Quote
  #165  
Old 04-23-2014, 04:50 AM
Bob_R Bob_R is offline
 
Join Date: Jun 2009
Posts: 535
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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



And after Vote thread, that issue not appear:



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 View Post
Can anyone help with this alignment issue? (see screenshot)

Thanks.
Post #164 the one right above this one????
Reply With Quote
  #166  
Old 04-24-2014, 02:27 PM
Morrus Morrus is offline
 
Join Date: Jan 2002
Posts: 494
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Impromptu View Post
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.
Reply With Quote
Благодарность от:
Bob_R
  #167  
Old 05-09-2014, 05:55 PM
GPOClan GPOClan is offline
 
Join Date: Oct 2010
Posts: 46
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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

Best regards,
Fields
Reply With Quote
  #168  
Old 05-14-2014, 01:24 PM
Bob_R Bob_R is offline
 
Join Date: Jun 2009
Posts: 535
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Is there an answer in our future?

thang28101993, Impromptu, and Morrus needs answers as well!!!!
Reply With Quote
  #169  
Old 06-01-2014, 09:01 PM
M.C. M.C. is offline
 
Join Date: Jan 2002
Posts: 463
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

nope... not working even if I put one forum ID works only with thread IDs
Reply With Quote
  #170  
Old 09-10-2014, 02:34 AM
fxdigi-cash fxdigi-cash is offline
 
Join Date: Jul 2012
Posts: 674
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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 {

Reply With Quote
Благодарность от:
tbworld
  #171  
Old 04-03-2017, 05:27 AM
Mohammad Kamal's Avatar
Mohammad Kamal Mohammad Kamal is offline
 
Join Date: Jan 2013
Location: Jordan
Posts: 16
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

How can I show more than one poll?
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 06:32 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.06058 seconds
  • Memory Usage 2,482KB
  • Queries Executed 28 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)bbcode_php
  • (4)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (11)post_thanks_box
  • (17)post_thanks_box_bit
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (4)post_thanks_postbit
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (6)postbit_attachment
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete