Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)
  #1  
Old 05-03-2005, 12:24 AM
theArchitect's Avatar
theArchitect theArchitect is offline
 
Join Date: Sep 2004
Location: Sydney
Posts: 417
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default GD Counter

I am needing to raise some money to keep my forum running and have noticed that a number of Forums are using a GD counter to keep their members appraised of the progress of the fundraising.

I would like to include such a counter on my forum but am not sure how to implement it.

If anyone knows how I would love to have the code etc.
Reply With Quote
  #2  
Old 05-03-2005, 02:54 PM
why-not why-not is offline
 
Join Date: Feb 2004
Posts: 218
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi

I would just keep the money value in a file and go from there! It's better than doing a query to get that value....

example.....

create a file called 'whatever', my example uses 'funds.php', I use php file so people can not look at what is the value by just calling the file!


Follow me....

create a file called 'funds.php'

Inside that file put....

the money you have collected so far...

Code:
<?

$raised_money = 23.85;

?>

Now create a script called 'fundraising.php'

Put that in your './includes/ directory

Inside that file put this....

Code:
<?
	define ( 'SYS_EOL', ( strtolower ( substr ( PHP_OS, 0, 3 ) ) == 'win' ? chr ( 13 ) . chr ( 10 ) : chr ( 10 ) ) );

	/* define the path to the font to use */

	define ( 'SYS_FSP', './fonts/gooddogcool.ttf' );


	function update_funds ( $file, $value )
	{
		$io = fopen ( $file, 'w' );
		fputs ( $io, '<?' . SYS_EOL . SYS_EOL . '$raised_money = ' . $value . ';' . SYS_EOL . SYS_EOL . '?>' );
		fclose ( $io );
	}

	function display_value ()
	{
		global $raised_money;

		$text = '$' . $raised_money;

		$image = imagecreate ( 164, 40 );
		$backg = imagecolorallocate ( $image, 255, 255, 255 );
		$textc = imagecolorallocate ( $image, 51, 102, 153 );
		$fsize = 36;
		$angle = 0;
		$horzp = 28;
		$vertp = 32;
		imagerectangle ( $image, 0, 0, 163, 36, $textc );
		imagettftext ( $image, $fsize, $angle, $horzp, $vertp, $textc, SYS_FSP, $text );
		header ( 'Content-type: image/gif;' );
		imagegif ( $image );
		imagedestroy ( $image );
	}
?>
You will have to change the path to the font and the font type used!

Now create another file that will be used to call the IMAGE....

I will use 'show.php'....

in that file put this....
Code:
<?

	include_once ( './funds.php' );
	include_once ( './includes/fundraising.php' );

	display_value ();

?>


Now to show the image!


In any template on your forum you would do this....

Code:
<img border='0' src='http://site.com/show.php' height='40' width='160' alt='' />
The result would be...

http://24.91.149.80/show.php


To update the value of money raised you would do this....

Code:
<?

	include_once ( './includes/fundraising.php' );
	update_funds ( '.funds.php', '56.50' );

?>
where as './funds' would be the file you are using to hold the money raised value!
and '56.50' would be replaced with the new real money raised value!


Sonia
Reply With Quote
  #3  
Old 05-04-2005, 12:25 AM
Dennis Olson Dennis Olson is offline
 
Join Date: Jul 2004
Location: Wisconsin
Posts: 137
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Here is EXACTLY what you want - already written and released:

https://vborg.vbsupport.ru/showthread.php?t=67425
Reply With Quote
  #4  
Old 05-04-2005, 12:27 AM
mholtum's Avatar
mholtum mholtum is offline
 
Join Date: May 2004
Location: Arizona
Posts: 697
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Dennis Olson
Here is EXACTLY what you want - already written and released:

https://vborg.vbsupport.ru/showthread.php?t=67425
That is the one I use.
Reply With Quote
  #5  
Old 05-04-2005, 07:42 AM
theArchitect's Avatar
theArchitect theArchitect is offline
 
Join Date: Sep 2004
Location: Sydney
Posts: 417
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Dennis Olson
Here is EXACTLY what you want - already written and released:

https://vborg.vbsupport.ru/showthread.php?t=67425
Thanks guys. That is just what I am after. I really need to learn how to search better, I did quickly run a search for this mod but could not find it.

Thanks for your help.
Reply With Quote
Reply

Thread Tools
Display Modes

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 02:12 AM.


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.07203 seconds
  • Memory Usage 2,197KB
  • Queries Executed 11 (?)
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)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (5)bbcode_code
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (5)post_thanks_box
  • (5)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (5)post_thanks_postbit_info
  • (5)postbit
  • (5)postbit_onlinestatus
  • (5)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_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete