vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   Closed Poll thread title (https://vborg.vbsupport.ru/showthread.php?t=52610)

Attrox 05-06-2003 11:16 PM

Cool addition, small, yet very useful. *clicks install*

Nice idea. :)

WEForums 05-06-2003 11:35 PM

Quote:

Yesterday at 11:46 PM Boofo said this in Post #18
Does it say Closed Poll: before you close the thread?
It only says "Closed Poll:" when the poll is closed via the moderator edit button. When closing the entire thread all that appears is "Poll:" like normal.

noppid 05-07-2003 03:09 AM

Quote:

Yesterday at 08:35 PM WEForums said this in Post #22
It only says "Closed Poll:" when the poll is closed via the moderator edit button. When closing the entire thread all that appears is "Poll:" like normal.
A new version 1.1 is posted with a new condition to show the poll closed if the thread is closed.

Thanks for the feedback.

Regards

noppid 05-07-2003 01:09 PM

Quote:

Yesterday at 07:06 PM Boofo said this in Post #20
Here is the link to my poll hack. Let me know if you think we can combine the two. ;)

https://vborg.vbsupport.ru/attachmen...&postid=372862

I was toast last night and really couldn't see well enough to read your code. I'll look closer at it today.

Boofo 05-07-2003 01:11 PM

Quote:

Today at 09:09 AM noppid said this in Post #24
I was toast last night and really couldn't see well enough to read your code. I'll look closer at it today.
No problem. Just when you get some time. ;)

noppid 05-07-2003 02:37 PM

OK to this line you need to add the active column name.

PHP Code:

FROM:
  
$polldatetime $DB_site->query_first("SELECT dateline, timeout from poll where pollid = $thread[pollid];");

TO:
  
$polldatetime $DB_site->query_first("SELECT dateline, timeout,active from poll where pollid = $thread[pollid];"); 

That will enable you to do this conditional check and output or similar...

PHP Code:


if($polldatetime['active']==|| $thread[open]==0) {
    
$thread[typeprefix]="<b><font color=#567688>Closed Poll:</b></font> ";
}   
else
    
$thread[typeprefix]=$pollthreadprefix

Hope that helps.

Regards

Boofo 05-07-2003 04:40 PM

I almost have it. I am working on a small problem. How do I go about get the total votes on a poll. I can pull them out but they look like this:

3|||2|||3|||2|||4|||

Like that. How do I get them into a total?

noppid 05-07-2003 05:13 PM

You can use a foreach loop with an explode statement .

PHP Code:

$totalvotes=0;
$myvotes explode("|||",$votesstring);
foreach(
$myvotes as $v ) {
    
$totalvotes $totalvotes $v;


That should work though I didn't test it.


EDIT:
repaired code

Boofo 05-07-2003 05:24 PM

Just tried it. It gives me 0 as the total votes and there are 10. ;)

noppid 05-07-2003 05:30 PM

Does $votesstring exist for you? If not did you substitute you var name that contains the ||| delimited string?


All times are GMT. The time now is 08:28 AM.

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.01225 seconds
  • Memory Usage 1,748KB
  • 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
  • (3)bbcode_php_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)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