vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Member Archives (https://vborg.vbsupport.ru/forumdisplay.php?f=202)
-   -   need help completing this code in functions.php (https://vborg.vbsupport.ru/showthread.php?t=43797)

michealo 09-22-2002 12:51 AM

need help completing this code in functions.php
 
xenon helped me a while back (thank you!) to add a line that would allow users to edit thier username and usertitle color IF they met a certain postcount minimum

PHP Code:

if($post[posts]>yyy$post[username]="<font color=".$post[fieldx].">".$post[username]."</font>"

is the code that allowed this to work

im trying to add another criteria where users can add glow to thier name using the same code. ive tried it several ways, and this is how i thought would make it work, but it just gives me a parse error

PHP Code:

if($post[posts]>yyy$post[username]="<table style="filter:glow(color=".$post[fieldx]."strength=2")>".$post[username]."</table>"

any help would be appreciated, thanks

TECK 09-22-2002 01:23 AM

Code:

if ($post['posts'] > 10) {
  $post['username'] = '<table style=filter:glow(color="' . $post[fieldx] . ', strength=2")>' . $post[username] . '</table>';
}


michealo 09-22-2002 01:42 AM

thanks, that code works

BUT it makes every user's name glow red, who has the required number of posts

i need it so the name doesnt glow if no color is specified in the profile field.

also, it only works if a hex color is entered.

thanks

Velocd 09-23-2002 06:33 PM

Quote:

also, it only works if a hex color is entered.
Hex colors are the only way to go, you don't actually input "blue", "red", etc. do you..??
[high]* Velocd shrieks in horror
[/high]

Actually it doesn't really matter, and I guess for members who know nothing about HTML that would be easier..

Use this code to make it so that if no color is inputted, the thing doesn't glow.

PHP Code:

if ($post['posts'] > 10 && $post['fieldx']) {
  
$post['username'] = '<table style=filter:glow(color="' $post[fieldx] . ', strength=2")>' $post[username] . '</table>';


That wont check though if the inputted value in fieldX is something other than a hex code.

If you want it to work with color names, just put this right below the IF statement, inside:

PHP Code:

if($post[fieldx] == "white"){
$post[fieldx] = "#FFFFFF";


And just replicate that code changing the values for each different color you want to add.

Hope any of this helps ;)

michealo 09-23-2002 09:57 PM

worked great, thanks!

it added a blank line beneath the name and above the usertitle, tho

but otherwise, looks good

Velocd 09-24-2002 01:15 AM

Check this part out:
PHP Code:

if ($post['posts'] > 10 && $post['fieldx']) {
  
$post['username'] = '<table style=filter:glow(color="' $post[fieldx] . ', strength=2")>' $post[username] . '</table>';


See those <table> tags..I personally don't recall the username being inbetween the <table> tags, so it's probably not needed.

Try replacing the <table> and </table> with a <td> and </td> tag, then with some tweaking around you should be able to remove the space maybe..

michealo 09-24-2002 03:36 PM

that worked great
this is the code i use for all three items: username color, usertitle color, and username glow color

i think it gets confused when setting the username colors and glow colors, cause the names only seem to glow red no matter what hex code it entered

PHP Code:


if($post[posts]>1500$post[usertitle]="<font color=".$post[field7].">".$post[usertitle]."</font>";



if(
$post[posts]>2000$post[username]="<font color=".$post[field6].">".$post[username]."</font>";



if (
$post['posts'] > 5000 && $post['field9']) { 

$post['username'] = '<span style=height:10;filter:glow(color=".$post[field9]." strength="1")>' $post[username] . '</span>'



i changed the ".$post[field9]." to #FFFFFF and everyone's name glowed white, so the code works. is there a way to combine the two if statements (username color and username glow color)?


All times are GMT. The time now is 06:31 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.01078 seconds
  • Memory Usage 1,747KB
  • 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
  • (6)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete