vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.7 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=228)
-   -   Forum Display Enhancements - [AJAX] Ajax Poll Preview (https://vborg.vbsupport.ru/showthread.php?t=166108)

Alphawolf83 12-24-2007 10:00 PM

[AJAX] Ajax Poll Preview
 
WORKS WITH 3.6.x to 3.8.x!

DESCRIPTION

We're living in a world of AJAX (at least some say so ;)), so why not minimize traffic by using AJAX technology? That's why I made this little hack for vbulletin (upon a request of a fellow mod on another forum).

So what this hack does is to display the poll results by hovering the thread poll icon in FORUMDISPLAY view (see screenshot), so you dont have to view the entire thread (and all its graphics and stuff) when you're just wanting to view the current poll results, and with this save forum traffic (though, granted, it's not that much). The hack uses the great jQuery javascript library and the modification jTip by Cody Lindley, which I've modified for proper vbulletin use (especially layout issues).

It uses every forum's custom style, so it'll look like it was made for your vbulletin. ;)

The hack has been tested on 3.7.0B3 and 3.6.8, but should work on 3.5.x aswell.

STATISTICS

File Uploads: 5
File Changes: 0
Template Changes: 1
Products to Install: 1
Time to Install: ~ 2 minutes


FEATURES
  • Configuration Options in the AdminCP
    • Enable the Inline Poll Preview Plugin? (bool)
    • Tooltip Width (int)
  • Uses AJAX technology, so no extra query on any page
  • Uses vbulletin's permission system


INSTALLATION

- Upload files from the upload folder
- Import the product via ACP > Manage Products > Import
- Do the template change (can also be found within the ZIP file!)

In threadbit template replace
PHP Code:

<if condition="$show['threadicon']"><img src="$thread[threadiconpath]alt="$thread[threadicontitle]border="0" /><else />&nbsp;</if> 

with
PHP Code:

<if condition="$show['threadicon']">
    <if 
condition="($vboptions[enable_inlinepollpreview]==TRUE) AND $thread['pollid']">
        <
a href="pollinline.php?width=$vboptions[tipwidth_inlinepollpreview]&threadid=$thread[realthreadid]&rand={$pollprevrand}class="jTip" id="pollpreview$thread[realthreadid]name="$thread[threadtitle]onclick="return false;"><img src="$thread[threadiconpath]alt="$thread[threadicontitle]border="0" /></a>
    <else />
        <
img src="$thread[threadiconpath]alt="$thread[threadicontitle]border="0" />
    </if>
<else />
    &
nbsp;
</if> 


CONFIGURATION

Note that by default (after installation) the hack in disabled! Go to the options page to enable and configure it.

The (yet) few configuration options shouldnt be hard to understand so no further info here. If someone has any questions (or suggestions), the hack is supported by myself. Just reply here.


SCREENSHOTS

1.) The options panel.
2.) Poll Preview on another forum layout.
3.) Permission message when the user doesnt have the rights to view thread's contents.
4.) Poll Preview in FORUMDISPLAY view.

VERSION HISTORY

0.5.5
- Fixed issue on vb3.7.0B3 with unregistered users using Internet Explorer
- Added some additional template caching
- Fixed issue when users were able to click the poll icon link and got a white results page

0.5.0
- Initial Release of Ajax Poll Preview

bokmade 12-25-2007 01:56 PM

<font color="red">Install ..</font>

Can You Make One For Thread Preview Just For Admin ..

Thanks ..

Forum Lover 12-25-2007 02:13 PM

great hack. planning to use it to my new board.

Lionel 12-25-2007 04:24 PM

very nice!

Alphawolf83 12-25-2007 05:04 PM

Quote:

Originally Posted by bokmade (Post 1408884)
Install ..

Can You Make One For Thread Preview Just For Admin ..

Thanks ..

Why, if I may ask? You can use the vbulletin permission system to deny certain usergroups to view thread content / poll results. :)

Magnumutz 12-25-2007 05:30 PM

Nice mod dude, good job !
Installed.

yahoooh 12-25-2007 05:32 PM

nice addon

SwollenCranium 12-25-2007 06:51 PM

The following error occurred when attempting to evaluate this template:
The conditional on line 18 appears to be missing its beginning tag (<if>). This may cause unexpected behavior.
This is likely caused by a malformed conditional statement. It is highly recommended that you fix this error before continuing, but you may continue as-is if you wish.


I get the above error .. repeatedly.

**** Corrected *****

User head space and timing error.

SwollenCranium 12-25-2007 07:41 PM

While using IE as an unregistered user I can not get the Ajax poll to auto populate. Also is it suppose to dynamically update ? Because I only see new poll results when I refresh the page.

Works fine in FF though.

FleaBag 12-25-2007 09:59 PM

Great hack, thanks for sharing. :)


All times are GMT. The time now is 11:30 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.01200 seconds
  • Memory Usage 1,753KB
  • 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
  • (2)bbcode_php_printable
  • (1)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
  • (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