vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   Completely Random Font Colours For Graffiti Wall (https://vborg.vbsupport.ru/showthread.php?t=80694)

sabret00the 04-27-2005 10:00 PM

Completely Random Font Colours For Graffiti Wall
 
Open "wall.php" and find:
PHP Code:

    $randcolor rand(1,9);
    if ( 
$randcolor == $color ImageColorAllocate($myimage2552550);
    elseif ( 
$randcolor == $color ImageColorAllocate($myimage2551650);
    elseif ( 
$randcolor == $color ImageColorAllocate($myimage25520147);
    elseif ( 
$randcolor == $color ImageColorAllocate($myimage25500);    
    elseif ( 
$randcolor == $color ImageColorAllocate($myimage255255255);            
    elseif ( 
$randcolor == $color ImageColorAllocate($myimage0255255);            
    elseif ( 
$randcolor == $color ImageColorAllocate($myimage2550255);            
    else 
$color ImageColorAllocate($myimage02550); 

and replace with
PHP Code:

    // +++ completely random colours
    
$randred rand(1,255);
    
$randgreen rand(1,255);
    
$randblue rand(1,255);

    
$color ImageColorAllocate($myimage$randred$randgreen$randblue);
    
// --- completely random colours 

now save and upload and you're done :)

nexialys 04-28-2005 12:41 PM

would be good to add a button on the wall entry field to select a random or not... this is good feature!

Vevina 04-28-2005 12:41 PM

Sweet installed :)

frankenberrie 04-28-2005 07:11 PM

Installed

vulture 04-28-2005 09:39 PM

The problem on my board is that it generates too many dark colours. Fix it by having the random value from 150-255
Code:

// +++ completely random bright colours
    $randred = rand(150,255);
    $randgreen = rand(150,255);
    $randblue = rand(150,255);

    $color = ImageColorAllocate($myimage, $randred, $randgreen, $randblue);
    // --- completely random bright colours


jugo 04-29-2005 01:37 AM

thanks

/me installs

MP3 04-29-2005 05:06 AM

any prnt scrn?? :(

Deska 04-29-2005 07:55 AM

Thank's for this hack!

MPDev 04-30-2005 01:26 AM

While developing the Wall I found that random colors didn't render well and I got alot of purple or brown even when it was trying to render some off yellow color. Sticking close to primaries will ensure as close as possible colors.

sabret00the 04-30-2005 05:39 AM

Quote:

Originally Posted by MPDev
While developing the Wall I found that random colors didn't render well and I got alot of purple or brown even when it was trying to render some off yellow color. Sticking close to primaries will ensure as close as possible colors.

i've been playing with this, it's a matter of php's favouritism to certain numbers, i've been trying to circumvent this with
PHP Code:

    $randred mt_rand(1,255);
    
$randgreen ceil(rand(1,85) + ceil(rand(1,170) / 2) + rand(1,85));
    
$randblue ceil(rand(1,510) / 2); 

but really i'm just playing with it.


All times are GMT. The time now is 07:32 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.01083 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
  • (1)bbcode_code_printable
  • (3)bbcode_php_printable
  • (1)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
  • (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