vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   Username Font Colour (https://vborg.vbsupport.ru/showthread.php?t=48976)

flame 02-15-2003 10:00 PM

Username Font Colour
 
This addon was requested Here

Basically wot this addon does is allow the user to buy a different font colour for his their Username.

It can also be mixed with the current "glow" and "italic" features that Lesane has already added to the store.

upload storeupdate.php to you admin dir and run via browser this will make the necessary database changes.
ive included a updated store.php with all the file changes involved ready to go. Remember and add the templates (preferably with Firefly's TBS)

Also Read the instructions.txt file as it has a file edit to be done before this addon will work.

Hope you enjoy

Flame

Savant 02-16-2003 07:07 AM

well it.. doesn't crash, but so far the only color that shows up is my default forum text color (a light blue) even if i put in #ffffff or #000000

and the hex color chooser dilly doesn't work... it pops up but clicking on the colors doesnt do much. Actually does nuthin heh. Not that it matters since the only available color at this point is my text color, but another lil bug :)

Anyhow, nothing terrible happens, but its not workin fer me yet :P :bunny:

flame 02-16-2003 03:42 PM

Did you run the file edit in the instructions.txt?

This is the only problem i can figure out it can be

Flame

LightBringer 02-16-2003 05:11 PM

I'm getting a database error when trying to run the script, is there any way you can give me the sql query so I can make the changes by hand? Thanks :)

mx3 02-16-2003 07:01 PM

could you like include in the instructions what to do to store.php? i already have changed it for other addons and i don't want to lose those...

Savant 02-16-2003 07:48 PM

yup, i did all the instructions... went back over em, everything looks in order.. but still no colors :( if anyone gets this workin, lemme know and il try over again :laugh:

JHSoundZ 02-18-2003 02:01 PM

cool for making this hack for us....
but doesnt seem to be working for ppl :(

also as mx3 sed if yaz fix it or whatever cud you please include insturctions on changes to store.php ... cause mine has quite a few of addons.

Dean C 02-18-2003 02:07 PM

How come i never saw these hacks two days ago?

THis is odd. Nice hack nevertheless buddy :)

Regards

- miSt

flame 02-18-2003 09:49 PM

k here are all the file changes needed.

in store.php find
PHP Code:

store_sticky,store_italic'; 

And replace with
PHP Code:

store_sticky,store_italic,store_fcolour,store_fcolour_verify,store_fcolour_changed'; 

Find:
PHP Code:

global $points$usertitle$username$userid$storename$pointname$glow$italic

And replace with
PHP Code:

global $points$usertitle$username$userid$storename$pointname$glow$italic$fcolour

Find:
PHP Code:

$username=$user[username]; 

And Below it Add
PHP Code:

$fcolour=$user[fcolour]; 

Find:
PHP Code:

if ($glow!="" AND $italic=="1") {
       
$username="<font style=\"filter:glow(color=$glow, strength=3);height=1px\"><i>$username</i></font>";
       } elseif (
$glow!="") {
       
$username="<font style=\"filter:glow(color=$glow, strength=3);height=1px\">$username</font>";
       } elseif (
$italic=="1") {
       
$username="<i>$username</i>";
       } else {
        echo 
"";
       } 

And replace with:
PHP Code:

if ($glow!="" AND $italic=="1" AND $fcolour!="") {
       
$username="<font color=\"$fcolour\" style=\"filter:glow(color=$glow, strength=3);height=1px\"><i>$username</i></font>";
       } elseif (
$glow!="" AND $fcolour!="") {
       
$username="<font color=\"$fcolour\" style=\"filter:glow(color=$glow, strength=3);height=1px\">$username</font>";
       } elseif (
$italic=="1" AND $fcolour!="") {
       
$username="<font color=\"$fcolour\"<i>$username</i></font>";
        } elseif (
$glow!="" AND $italic=="1") {
        
$username="<font style=\"filter:glow(color=$glow, strength=3);height=1px\"><i>$username</i></font>";
          } elseif (
$glow!="") {
        
$username="<font style=\"filter:glow(color=$glow, strength=3);height=1px\">$username</font>";
} elseif (
$fcolour!="") {
        
$username="<font color=\"$fcolour\">$username</font>";
} elseif (
$italic=="1") {
        
$username="<i>$username</i>";
} else {
        echo 
"";
       } 

Find:
PHP Code:

// oweee, 1252 Lines Of Code And It keeps Growing...... 

And Above it add:
PHP Code:

// ###################### Start font colour ###########
if ($action=="fcolour") {

$contest $DB_site->query_first("SELECT * FROM store WHERE action='fcolour'");
$title=$contest[title];
$cost=$contest[costs];

if (
$cost>$points) {
eval(
"standarderror(\"".gettemplate('store_error')."\");");
}

if (
$glow!="") {
       eval(
"dooutput(\"".gettemplate("store_fcolour_change")."\");"); 
       } else {
eval(
"dooutput(\"".gettemplate("store_fcolour")."\");");
}

}
// ###################### Start font colour Verify #######################
if ($action=="fcolourverify") {

  
$contest $DB_site->query_first("SELECT * FROM store WHERE action='fcolour'");
  
$storeid=$contest[id];
  
$cost=$contest[costs];
  
$need=$points $cost;
  
if (
$cost>$points) {
eval(
"standarderror(\"".gettemplate('store_error')."\");");
}

eval(
"dooutput(\"".gettemplate("store_fcolour_verify")."\");");
}

// ###################### Start font colour Change #######################
if ($action=="fcolourchanged") {

if (
$fcolour!="") {
$changeusernow $DB_site->query("UPDATE user SET storep=storep-$cost, fcolour='$nfcolour' WHERE userid='$bbuserinfo[userid]'");
$changestorenow $DB_site->query("UPDATE store SET sold=sold+1 WHERE id='$storeid'");
$storequant $DB_site->query_first("SELECT * FROM store");
if (
$storequant[quantity]=='0') {
$ilove++++++s="";
} elseif (
$storequant[quantity]=='1') {
$closequan $DB_site->query("UPDATE store SET quantity='0', ok='N' WHERE id='$storeid'");
} else {
$updatequan $DB_site->query("UPDATE store SET quantity=quantity-1 WHERE id='$storeid'");
}
$moneycheck $DB_site->query_first("SELECT storep FROM user WHERE userid='$bbuserinfo[userid]'");
$money $moneycheck[storep];
$whath="Changed";
$what="changed";
eval(
"dooutput(\"".gettemplate("store_fcolour_changed")."\");");
} else {
$changeusernow $DB_site->query("UPDATE user SET storep=storep-$cost, fcolour='$nfcolour' WHERE userid='$bbuserinfo[userid]'");
$changestorenow $DB_site->query("UPDATE store SET sold=sold+1 WHERE id='$storeid'");
$storequant $DB_site->query_first("SELECT * FROM store");
if (
$storequant[quantity]=='0') {
$ilove++++++s="";
} elseif (
$storequant[quantity]=='1') {
$closequan $DB_site->query("UPDATE store SET quantity='0', ok='N' WHERE id='$storeid'");
} else {
$updatequan $DB_site->query("UPDATE store SET quantity=quantity-1 WHERE id='$storeid'");
}
$moneycheck $DB_site->query_first("SELECT storep FROM user WHERE userid='$bbuserinfo[userid]'");
$money $moneycheck[storep];
$whath="Added";
$what="added";
eval(
"dooutput(\"".gettemplate("store_fcolour_changed")."\");");
}
}

// ###################### Start font colour Delete Verify #######################
if ($action=="fcolourdelete") {

  
$contest $DB_site->query_first("SELECT id,costs FROM store WHERE action='fcolour'");
  
$storeid=$contest[id];
  
$cost=$contest[costs];
  
$need=$points $cost;

if (
$cost>$points) {
eval(
"standarderror(\"".gettemplate('store_error')."\");");
}

eval(
"dooutput(\"".gettemplate("store_fcolour_delete")."\");");
}

// ###################### Start Delete font colour #######################
if ($action=="deletefcolour") {

$changeusernow $DB_site->query("UPDATE user SET storep=storep-$cost, fcolour='' WHERE userid='$bbuserinfo[userid]'");
$moneycheck $DB_site->query_first("SELECT storep FROM user WHERE userid='$bbuserinfo[userid]'");
$money $moneycheck[storep];
eval(
"dooutput(\"".gettemplate("store_fcolour_deleted")."\");");


Thats All for Store.php

In admin/functions.php
Find:
PHP Code:

if ($post[glow]!="" AND $post[italic]=="1") {
       eval(
"\$storeextraglow = \"".gettemplate('store_extra_glow_italic')."\";");  
       } elseif (
$post[glow]!="") {
       eval(
"\$storeextraglow = \"".gettemplate('store_extra_glow')."\";");
       } elseif (
$post[italic]=="1") {
       
$storeextraglow="<i>$post[username]</i>";
       } else {
        
$storeextraglow="$post[username]";
       } 

And Replace with:
PHP Code:

if ($post[glow]!="" AND $post[italic]=="1" AND $post[fcolour]!="") {
       eval(
"\$storeextraglow = \"".gettemplate('store_extra_glow_italic_fcolour')."\";");
          } elseif (
$post[glow]!="" AND $post[fcolour]!="") {
             eval(
"\$storeextraglow = \"".gettemplate('store_extra_glow_fcolour')."\";");
          } elseif (
$post[italic]=="1" AND $post[fcolour]!="") {
             eval(
"\$storeextraglow = \"".gettemplate('store_extra_italic_fcolour')."\";");
          } elseif (
$post[glow]!="" AND $post[italic]=="1") {
             eval(
"\$storeextraglow = \"".gettemplate('store_extra_glow_italic')."\";");  
          } elseif (
$post[glow]!="") {
         eval(
"\$storeextraglow = \"".gettemplate('store_extra_glow')."\";");
      } elseif (
$post[fcolour]!="") {
         eval(
"\$storeextraglow = \"".gettemplate('store_extra_fcolour')."\";");
      } elseif (
$post[italic]=="1") {
       
$storeextraglow="<i>$post[username]</i>";
       } else {
        
$storeextraglow="$post[username]";
       } 

Save and upload Both Files.

The database queries as requested are:
PHP Code:

ALTER TABLE user ADD fcolour varchar(255NOT NULL DEFAULT '' 

And
PHP Code:

INSERT INTO store VALUES (20'fcolour''Add A Font Colour To Username''200''0''colour.gif''With this action you can add an attractive Font color to your username wich you can define yourself. If you have already a Font Colour then you can change it here aswell.''Y','0' 

And obviously upload the templates from post #1 of this thread

Hope this helps thoses ppl that couldnt get the install file to work

Flame

Limitter 02-19-2003 01:19 PM

Must edit the "Picker.html" ???

I could not select, i had the file with the Varuiable

PHP Code:

function passColor(color) {
    
window.opener.document.name.elements.nfcolour.value color

again provides

Greetz and thx for this nice addon

L.


All times are GMT. The time now is 01:50 PM.

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.03031 seconds
  • Memory Usage 1,857KB
  • 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
  • (15)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)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