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

Reply
 
Thread Tools
need help completing this code in functions.php Details »»
need help completing this code in functions.php
Version: , by michealo michealo is offline
Developer Last Online: Jun 2008 Show Printable Version Email this Page

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

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

Show Your Support

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

Comments
  #2  
Old 09-22-2002, 01:23 AM
TECK's Avatar
TECK TECK is offline
 
Join Date: Nov 2001
Location: Canada
Posts: 4,182
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Code:
if ($post['posts'] > 10) {
  $post['username'] = '<table style=filter:glow(color="' . $post[fieldx] . ', strength=2")>' . $post[username] . '</table>';
}
Reply With Quote
  #3  
Old 09-22-2002, 01:42 AM
michealo michealo is offline
 
Join Date: Jun 2002
Posts: 64
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #4  
Old 09-23-2002, 06:33 PM
Velocd's Avatar
Velocd Velocd is offline
 
Join Date: Mar 2002
Location: CA University
Posts: 1,696
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #5  
Old 09-23-2002, 09:57 PM
michealo michealo is offline
 
Join Date: Jun 2002
Posts: 64
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

worked great, thanks!

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

but otherwise, looks good
Reply With Quote
  #6  
Old 09-24-2002, 01:15 AM
Velocd's Avatar
Velocd Velocd is offline
 
Join Date: Mar 2002
Location: CA University
Posts: 1,696
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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..
Reply With Quote
  #7  
Old 09-24-2002, 03:36 PM
michealo michealo is offline
 
Join Date: Jun 2002
Posts: 64
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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)?
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 05:20 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.04491 seconds
  • Memory Usage 2,282KB
  • Queries Executed 20 (?)
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)bbcode_code
  • (6)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (7)post_thanks_box
  • (7)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (7)post_thanks_postbit_info
  • (6)postbit
  • (7)postbit_onlinestatus
  • (7)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