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. :)

bokmade 12-26-2007 09:44 AM

Quote:

Originally Posted by Alphawolf83 (Post 1408962)
Why, if I may ask? You can use the vbulletin permission system to deny certain usergroups to view thread content / poll results. :)

No I'm Looking for Ajax thread Preview mod and just the admin can used this function ..

Hornstar 12-26-2007 11:04 AM

yeah looking forward to vbulletin implementing new and useful ajax ways to save bandwidth. Thanks.

Alphawolf83 12-26-2007 12:26 PM

Quote:

Originally Posted by SwollenCranium (Post 1409001)
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.

What vb version are you running? And when does the error appear? I am using the hack on 2 productive boards and didnt get any error messages yet...

Quote:

Originally Posted by SwollenCranium (Post 1409016)
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.

Well, I tested it and works fine in IE7 on vb3.7.0B3 as a guest. Can I have a link? :)

Quote:

Originally Posted by bokmade (Post 1409324)
No I'm Looking for Ajax thread Preview mod and just the admin can used this function ..

Well, I thought there's such a hack already, which pops up the first (or last) post of a thread using AJAX. A forum search might help. :)

SwollenCranium 12-26-2007 06:05 PM

Quote:

Originally Posted by Alphawolf83 (Post 1409401)
What vb version are you running? And when does the error appear? I am using the hack on 2 productive boards and didnt get any error messages yet...


Well, I tested it and works fine in IE7 on vb3.7.0B3 as a guest. Can I have a link? :)


I'm running 3.7 beta 3.

I fixed the if tag issue.

But still get the white page in IE.

And this is the ERROR I get ---> Here.

This is the actual forum display link ---> here


I've had 14 different users confirm my error with IE. Works EVERY time for a registered user, but almost never for an unregistered first time viewer using IE.

After clearing cookies on my IE, I am even able to reproduce this effect in about 75% of my tries.




**********
I may be crazy but having unregistered access to some features is vital in building a member base. There are problems with Vbulletin and Vblog with unregistered users, I've already listed them in the bug section.

Sofia 12-27-2007 07:55 AM

nice hack:) Thanks a lot ;)

Alphawolf83 12-27-2007 01:29 PM

Quote:

Originally Posted by SwollenCranium (Post 1409577)
I fixed the if tag issue.

May I ask what the problem has been? :)

Quote:

Originally Posted by SwollenCranium (Post 1409577)
But still get the white page in IE.

And this is the ERROR I get ---> Here.

This is the actual forum display link ---> here

I've had 14 different users confirm my error with IE. Works EVERY time for a registered user, but almost never for an unregistered first time viewer using IE.

After clearing cookies on my IE, I am even able to reproduce this effect in about 75% of my tries.

I guess I managed to fix all the issues you had. Would you please download the new version 0.5.5 and give feedback if that helped? :) If so, I can send out an update.

Thanks for your feedback!

SwollenCranium 12-27-2007 06:07 PM

Quote:

Originally Posted by Alphawolf83 (Post 1410109)
May I ask what the problem has been? :)

It was an editing error on MY part. I inadvertently removed a closing > from an 'if' .




Quote:

Originally Posted by Alphawolf83 (Post 1410109)
I guess I managed to fix all the issues you had. Would you please download the new version 0.5.5 and give feedback if that helped? :) If so, I can send out an update.

Thanks for your feedback!

Thanks for your efforts, it appears to have solved the problem. :up:

Xplorer4x4 01-11-2008 04:23 PM

It's be great to see AJAX used for counting the votes, and showing the poll results in showthread. Any chance you might work on such a hack?

Alphawolf83 01-12-2008 04:46 PM

Quote:

Originally Posted by Xplorer4x4 (Post 1419645)
It's be great to see AJAX used for counting the votes, and showing the poll results in showthread. Any chance you might work on such a hack?

Well, what'd be the difference to the way it's handeled at the moment? :)

iBaker 03-03-2008 07:35 AM

Hi
Installed this hack into v3.7 BETA 5 and it works ok using Firefox but all I get is the question mark showing in IE and nothing else. Any suggestions - thanks for a great addon but unfortunately I have uninstalled

GoodKarmaKid 03-22-2008 12:02 AM

Installed and working on vb3.7 RC1

One issue that came up though is:

When a poll is set to sticky, it shows some funky "onclick="return false;"> with the poll post icon in thread view. the strange thing is the error doesn't show if it isn't a sticky post.

If I turn off the ajax poll preview, the formatting error goes away.

FYI,

I have the seperate stickys mod installed

& the ZH Sticky Thread Mark-up mod installed.

This is a really cool mod, and i like but I have temp disabled it while I have a poll in the sticky.

thanks,
Jason

Breathex 03-26-2008 12:09 AM

I want you to know, this hack crashes with the Ajax Fisheye Menu hack.

Jase2 05-13-2008 05:45 PM

This has the potential to be a good hack. Doesn't work in 3.7.0 though. :(

Alphawolf83 05-13-2008 06:17 PM

Quote:

Originally Posted by iBaker (Post 1455728)
Hi
Installed this hack into v3.7 BETA 5 and it works ok using Firefox but all I get is the question mark showing in IE and nothing else. Any suggestions - thanks for a great addon but unfortunately I have uninstalled

I've set up a fresh vb3.7 FINAL installation, applied the template changes, and it works fine in both IE7 and FF2 for me. You've tried it with BETA 5. Still having the problem with the FINAL?

Quote:

Originally Posted by Breathex (Post 1474649)
I want you to know, this hack crashes with the Ajax Fisheye Menu hack.

I'll have a look into this. May you provide a screenshot?

Quote:

Originally Posted by Jase2 (Post 1518526)
This has the potential to be a good hack. Doesn't work in 3.7.0 though. :(

For me it does. Note that by default the hack is disabled. Go to the options to activate it. Did that already? :)

jost 07-17-2008 10:52 AM

hej, it is not working in 3.7.2 with vbSEO installed.

drsli 07-30-2008 07:24 PM

Thank your for this interesting and useful hack! :)

I discovered no probs so far with the hack and vbseo on 3.72. :up:

Alphawolf83 07-30-2008 07:48 PM

That's nice to hear. :) Thanks for your feedback!

vbboarder 08-28-2008 01:46 AM

Thanks for this cool mod! Tested it with VB 3.7.3 - works fine in Firefox 2 but does not work in IE7. Can you please fix? ;)

TheJordan 09-18-2008 05:57 AM

I like the hack. I had it installed for a little while, but some of my users - just the ones using mobile devices such as a PSP - were unable to browse the forum pages with this enabled.

soqzippo 09-19-2008 11:36 AM

when i hover over the poll icon all i get is a question mark... I've done everything that is described in the instructions. Any idea whats going on?

soqzippo 09-20-2008 05:59 PM

helooooooooooo?????????????????????????????????

Alphawolf83 10-06-2008 01:33 PM

Quote:

Originally Posted by soqzippo (Post 1626487)
helooooooooooo?????????????????????????????????

Sorry, I've been pretty busy.

I tested the addon both on FF3 and IE7 with vb3.7.3PL1, and it worked in both browsers for me. No other hacks installed. May you please provide a link?

OcR Envy 06-04-2009 05:10 PM

Old mod bump ;)

Any way I can get the date when the poll was created to display on this preview?

Alphawolf83 06-04-2009 07:23 PM

Quote:

Originally Posted by OcR Envy (Post 1823437)
Old mod bump ;)

Any way I can get the date when the poll was created to display on this preview?

Well, I don't see any available variable like $pollstartdate or so. There are only two named $pollenddate or $pollendtime to use in templates.

biome.pat 07-10-2009 03:35 PM

Works for me in 3.8.3

NTMID8 08-14-2009 04:16 AM

Quote:

Originally Posted by biome.pat (Post 1846421)
Works for me in 3.8.3

Also have this working in 3.8.3. Just one request hopefully someone can help me with. When I go to a forum and see the poll icon, I can hover and everything works great. However, when I click on New Posts to retrieve a list of new posts, the popup does not work. I see the link in the status bar and it looks identical as on the threadbit, but no number after the rand= portion of the link.

Anyway, if I could get this to also work for the New Posts view it would be superb. Thanks for any help!

Alphawolf83 08-15-2009 02:18 PM

Quote:

Originally Posted by biome.pat (Post 1846421)
Works for me in 3.8.3

Quote:

Originally Posted by NTMID8 (Post 1866955)
Also have this working in 3.8.3. Just one request hopefully someone can help me with. When I go to a forum and see the poll icon, I can hover and everything works great. However, when I click on New Posts to retrieve a list of new posts, the popup does not work. I see the link in the status bar and it looks identical as on the threadbit, but no number after the rand= portion of the link.

Anyway, if I could get this to also work for the New Posts view it would be superb. Thanks for any help!

Thanks both for the info!

NTMID8 08-29-2009 04:27 PM

Still trying to figure out how to get the preview to work the same when you are viewing the New Posts list. Anyone able to help?

NTMID8 09-20-2009 04:52 AM

Quote:

Originally Posted by Alphawolf83 (Post 1867900)
Thanks both for the info!

Could you please help me get this working in the search_results template? I've added the code but the preview does not work and the URL I'm shown when hovering ends with rand= with no trailing number.

Calystos 11-28-2009 08:29 AM

Anyway of getting this to work with other areas of the site, such as Vbadvanced CMPS portal?


All times are GMT. The time now is 06:02 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.01513 seconds
  • Memory Usage 1,856KB
  • 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
  • (20)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)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