Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > General > Member Archives
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
variation of FireFly's "Online Users" hack Details »»
variation of FireFly's "Online Users" hack
Version: , by TECK TECK is offline
Developer Last Online: Nov 2023 Show Printable Version Email this Page

Version: Unknown Rating:
Released: 04-11-2002 Last Update: Never Installs: 0
 
No support by the author.

i want to change this hack to make it use images instead of numbers. an easy way to do would be to make one zillion gif files named 1.gif, 2.gif.... 894.gif. however, a much more elegant solution would be to create all the digits individually, then have them replace the actual values. so if i have 89 members online the 2 digits will be replaced by 8.gif and 9.gif.

i'm not sure what is the exact aproach on this. can you spare few minutes of your time and give me a solution?
please, post a code example in this thread.

i attached a picture, so you see actually what i try to achieve.
thanks for taking the time to help me solve this problem.

Download Now

File Type: (21.3 KB, 57 views)

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #12  
Old 04-17-2002, 05:48 AM
Neo's Avatar
Neo Neo is offline
 
Join Date: Oct 2001
Location: Anywhere
Posts: 1,817
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

well here is a example:

$var1 += $var2

now this is using the +=

this is what it would look like but do the same thing with out the +=

$var1 = $var1 + $var2
Reply With Quote
  #13  
Old 04-17-2002, 05:52 AM
TECK's Avatar
TECK TECK is offline
 
Join Date: Nov 2001
Location: Canada
Posts: 4,182
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

ok.. i understand.. then the code will not work the way i put it..
it will look for 89.gif instead of 8.gif 9.gif

what is the solution?
thanks for your help.
Reply With Quote
  #14  
Old 04-17-2002, 07:54 AM
Zzed's Avatar
Zzed Zzed is offline
 
Join Date: Feb 2002
Location: Glendale, CA, USA
Posts: 463
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I just ran that little code snippet. It does create a string with 8.gif and 9.gif.
Reply With Quote
  #15  
Old 04-17-2002, 07:59 AM
Admin's Avatar
Admin Admin is offline
Coder
 
Join Date: Oct 2023
Location: Server
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Don't touch that part of the code. Create the images string after the loop, not inside.
Reply With Quote
  #16  
Old 04-17-2002, 08:23 AM
TECK's Avatar
TECK TECK is offline
 
Join Date: Nov 2001
Location: Canada
Posts: 4,182
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

so it will look like?
PHP Code:
if ($getchildforum[parentid]==$forumid) {
  
$threadcount+=$getchildforum[threadcount];
}
$threadcountimage='<img src="'.implode('.gif"><img src="',preg_split('//',(string) $threadcount+,-1,PREG_SPLIT_NO_EMPTY)).'.gif">'
let me know if it correct. thanks.
Reply With Quote
  #17  
Old 04-17-2002, 08:28 AM
TECK's Avatar
TECK TECK is offline
 
Join Date: Nov 2001
Location: Canada
Posts: 4,182
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

nope.. is better this way:
PHP Code:
    $forumslist.=",$getchildforum[forumid]";
  }
  
$DB_site->free_result($getchildforums);
  
$threadcountimage='<img src="'.implode('.gif"><img src="',preg_split('//',(string) $threadcount+,-1,PREG_SPLIT_NO_EMPTY)).'.gif">'
am i correct?
Reply With Quote
  #18  
Old 04-17-2002, 08:51 AM
TECK's Avatar
TECK TECK is offline
 
Join Date: Nov 2001
Location: Canada
Posts: 4,182
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

nope. not working.. getting parse errors all over the place.
i tried also single quoted.. same result.
Reply With Quote
  #19  
Old 04-17-2002, 09:09 AM
TECK's Avatar
TECK TECK is offline
 
Join Date: Nov 2001
Location: Canada
Posts: 4,182
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

ok.. i think i got it:
PHP Code:
$forumslist.=",$getchildforum[forumid]";
}
$DB_site->free_result($getchildforums);
$threadcountimage='<img src="'.implode('.gif"><img src="',preg_split('//',(string) $threadcount,-1,PREG_SPLIT_NO_EMPTY)).'.gif">'
i forgot about the +, there is no need to have it there.. thanks alot ZZed.
i will let you all know tomorrow if it worked.
Reply With Quote
  #20  
Old 04-17-2002, 04:17 PM
Admin's Avatar
Admin Admin is offline
Coder
 
Join Date: Oct 2023
Location: Server
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Create a function to do that stuff... i.e:
Code:
function num2img ($number, $path = '') {
	return '<img src="' . implode('.gif"><img src="', preg_split('//', (string) $number, -1, PREG_SPLIT_NO_EMPTY)).' . gif">';
}
Stick that in functions.php and then just use it like this:
Code:
$threadcountimage = num2img($threadcount);
Reply With Quote
  #21  
Old 04-17-2002, 04:59 PM
TECK's Avatar
TECK TECK is offline
 
Join Date: Nov 2001
Location: Canada
Posts: 4,182
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thanks alot firefly.
excellent idea the function.

btw, i'm trying the "answer through email"...

__________________________________________________ _______________
Send and receive Hotmail on your mobile device: http://mobile.msn.com
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 04:17 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.04571 seconds
  • Memory Usage 2,332KB
  • Queries Executed 26 (?)
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
  • (2)bbcode_code
  • (3)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (1)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_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
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • 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