Author Topic: Some Name Alteration Items  (Read 80031 times)

Offline David

Re: Some Name Alteration Items
« Reply #30 on: April 06, 2007, 01:34:08 am »
Try this:

Code: [Select]
<?php

/**********************************************\

| SMFSHOP (Shop MOD for Simple Machines Forum) |

|         (c) 2005 DanSoft Australia           |

|      http://www.dansoftaustralia.net/        |

\**********************************************/



//File: Change_Font.php

//This item allows users to change their name font using a drop down menu.


//NOTE: This item requires that the DisplayNameCSS addon item be installed!

//Authors Website: www.graphicaddicts.net


//VERSION: 1.0

//DATE: April 21st 2006



class item_Change_Font extends itemTemplate {

    function 
getItemDetails() {
        
$this->name "Change Name Font!";
        
$this->desc "Change the font of your display name to: Arial, Comic Sans, Courier, Papyrus, Times, Verdana.";
        
$this->price 75;

        
$this->require_input true;
        
$this->can_use_item true;
    }



    function 
getUseInput() {

        return 
'Select a Font: <select name="font_" size="1" id="color">
    <option value="">Select One</option>
    <option value="font-family: Arial" style="font-family: Arial;color:#FFFFFF;background-color:#000000">Arial</option>
<option value="font-family: Comic Sans MS" style="font-family: Comic Sans MS">Comic Sans MS</option>
<option value="font-family: Courier New" style="font-family: Courier New">Courier New</option>
    <option value="font-family: Papyrus" style="font-family: Papyrus">Papyrus</option>
<option value="font-family: Times New Roman" style="font-family: Times New Roman">Times New Roman</option>
<option value="font-family: Verdana" style="font-family: Verdana">Verdana</option>

  </select>'
;

    }



    function 
onUse() {

        global 
$db_prefix$ID_MEMBER;

        

        
$result db_query("UPDATE {$db_prefix}members
                            SET shop_nameStyle = 
                                
                                concat(shop_nameStyle,'
{$_POST['font_']};')
                            WHERE ID_MEMBER = 
{$ID_MEMBER}",
                            
__FILE____LINE__);



        return 
"Successfully updated your display name font!";

    }



}



?>

Offline perplexed

Re: Some Name Alteration Items
« Reply #31 on: April 06, 2007, 01:38:40 am »
thanks David, but I tried it and it didnt work either.

I wonder if there is something that prevents the actual font from being changed in smf?
Estne volumen in toga, an solum tibi libet me videre?

Offline David

Re: Some Name Alteration Items
« Reply #32 on: April 06, 2007, 01:52:29 am »
Hmmm I tried it too and it did work for me (comes as a bit of a shock I know.) Would you mind giving a few details? SMF version for instance...anything in the error log from this item?

Offline perplexed

Re: Some Name Alteration Items
« Reply #33 on: April 06, 2007, 01:57:18 am »
smf 1.1.2 and no errors.  It says that I successfully used the item but then it doesnt change the font

I tried twice - comic sans and papyrus - to no avail
Estne volumen in toga, an solum tibi libet me videre?

Offline David

Re: Some Name Alteration Items
« Reply #34 on: April 06, 2007, 02:05:49 am »
I'm on SMF 1.1.2 too so it can't be that.

Silly questions as I'll bet you've got them sorted already...bear with me.

Have you got the ChangeDisplayNameCSS.php file installed (yes I know the answer already...you have)?

Have you tried clearing your browser cache after the font change?

 I suppose it's best to ask the obvious things just to get them out of the way but I don't have any other ideas as to why it wouldn't work for you but does for me.

 Actually...try a reboot so as to completely clear all temp settings then give it another go if you'd be so kind.
« Last Edit: April 06, 2007, 02:07:33 am by David »

Offline perplexed

Re: Some Name Alteration Items
« Reply #35 on: April 06, 2007, 02:09:31 am »
changdisplaynamecss.php - yes as I have other name changing things working

browser cache - yes again

I might try it my other forum and see what happens


oh - just wondering, will the name resetter reset font as well as the other name change items?
Estne volumen in toga, an solum tibi libet me videre?

Offline David

Re: Some Name Alteration Items
« Reply #36 on: April 06, 2007, 02:12:48 am »
Well...it is for me so what can I say but yes.

 I've got it working on a test forum of mine and will give you an account so you can play with it if that would help...in fact you can have an admin account as it's a test forum if that too would be of use.

Offline David

Re: Some Name Alteration Items
« Reply #37 on: April 06, 2007, 04:47:48 am »
I've added quite a few more fonts and put the whole lot into the change all item:

Code: [Select]
<?php

/**********************************************\

| SMFSHOP (Shop MOD for Simple Machines Forum) |

|         (c) 2005 DanSoft Australia           |

|      http://www.dansoftaustralia.net/        |

\**********************************************/



//File: Change_All_2.php

//This item allows users to change their name color, background color and style from three separate
//drop down menus.


//NOTE: This item requires that the DisplayNameCSS addon item be installed!

//Authors Website: www.graphicaddicts.net



//VERSION: 1.0

//DATE: April 21st 2006



class item_Change_All_2 extends itemTemplate {

    function 
getItemDetails() {
        
$this->name "Change Name Fonts, Colors and Style!";
        
$this->desc "Change the text font, color, style and background color of your display name.";
        
$this->price 75;

        
$this->require_input true;
        
$this->can_use_item true;
    }



    function 
getUseInput() {

        return 
'Select a Font: <select name="font_" size="1" id="color">
    <option value="">Select One</option>
    <option value="font-family: Arial" style="font-family: Arial;color:#FFFFFF;background-color:#000000">Arial</option>
<option value="font-family: Arial Black" style="font-family: Arial Black">Arial Black</option>
<option value="font-family: Arial Narrow" style="font-family: Arial Narrow">Arial Narrow</option>
<option value="font-family: Arial Unicode MS" style="font-family: Arial Unicode MS">Arial Unicode MS</option>
<option value="font-family: Book Antiqua" style="font-family: Book Antiqua">Book Antiqua</option>
<option value="font-family: Bookman Old Style" style="font-family: Bookman Old Style">Bookman Old Style</option>
<option value="font-family: Century Gothic" style="font-family: Century Gothic">Century Gothic</option>
<option value="font-family: Comic Sans MS" style="font-family: Comic Sans MS">Comic Sans MS</option>
<option value="font-family: Courier New" style="font-family: Courier New">Courier New</option>
    <option value="font-family: Garamond" style="font-family: Garamond">Garamond</option>
<option value="font-family: Georgia" style="font-family: Georgia">Georgia</option>
<option value="font-family: Impact" style="font-family: Impact">Impact</option>
<option value="font-family: Lucida Console" style="font-family: Lucida Console">Lucida Console</option>
<option value="font-family: Lucida Sans Unicode" style="font-family: Lucida Sans Unicode">Lucida Sans Unicode</option>
<option value="font-family: Palatino Linotype" style="font-family: Palatino Linotype">Palatino Linotype</option>
<option value="font-family: Papyrus" style="font-family: Papyrus">Papyrus</option>
<option value="font-family: Times New Roman" style="font-family: Times New Roman">Times New Roman</option>
<option value="font-family: Trebuchet MS" style="font-family: Trebuchet MS">Trebuchet MS</option>
<option value="font-family: Verdana" style="font-family: Verdana">Verdana</option>

  </select>
      
   <br /><br />

Select a Text Color: <select name="color_" size="1" id="color">
    <option value="">Select One</option>
    <option value="color:#FFFFFF" style="color:#FFFFFF;background-color:#000000">White</option>
    <option value="color:#000000" style="color:#000000">Black</option>
    <option value="color:#d80000" style="color:#d80000">Light Red</option>
<option value="color:#b70000" style="color:#b70000">Medium Red</option>
<option value="color:#750000" style="color:#750000">Dark Red</option>
    <option value="color:#FF9000" style="color:#FF9000">Light Orange</option>
<option value="color:#D37C00" style="color:#D37C00">Medium Orange</option>
<option value="color:#AF6B00" style="color:#AF6B00">Dark Orange</option>
<option value="color:#FFFC00" style="color:#FFFC00">Light Yellow</option>
<option value="color:#D3D100" style="color:#D3D100">Medium Yellow</option>
<option value="color:#AFAD00" style="color:#AFAD00">Dark Yellow</option>
<option value="color:#14D800" style="color:#14D800">Light Green</option>
<option value="color:#11B700" style="color:#11B700">Medium Green</option>
<option value="color:#0B7500" style="color:#0B7500">Dark Green</option>
<option value="color:#0061D8" style="color:#0061D8">Light Blue</option>
<option value="color:#0038B7" style="color:#0038B7">Medium Blue</option>
<option value="color:#002975" style="color:#002975">Dark Blue</option>
<option value="color:#7A00D8" style="color:#7A00D8">Light Indigo</option>
<option value="color:#6300B7" style="color:#6300B7">Medium Indigo</option>
<option value="color:#3F0075" style="color:#3F0075">Dark Indigo</option>
<option value="color:#B200D8" style="color:#B200D8">Light Violet</option>
<option value="color:#8E00B7" style="color:#8E00B7">Medium Violet</option>
<option value="color:#5B0075" style="color:#5B0075">Dark Violet</option>
  </select>
  
   <br /><br />
        
    Select a Background Color: <select name="bgcolor_" size="1" id="color">
    <option value="">Select One</option>
    <option value="background-color:#FFFFFF" style="background-color:#FFFFFF">White</option>
    <option value="background-color:#000000" style="background-color:#000000;color:#FFFFFF">Black</option>
    <option value="background-color:#d80000" style="background-color:#d80000">Light Red</option>
<option value="background-color:#b70000" style="background-color:#b70000">Medium Red</option>
<option value="background-color:#750000" style="background-color:#750000">Dark Red</option>
    <option value="background-color:#FF9000" style="background-color:#FF9000">Light Orange</option>
<option value="background-color:#D37C00" style="background-color:#D37C00">Medium Orange</option>
<option value="background-color:#AF6B00" style="background-color:#AF6B00">Dark Orange</option>
<option value="background-color:#FFFC00" style="background-color:#FFFC00">Light Yellow</option>
<option value="background-color:#D3D100" style="background-color:#D3D100">Medium Yellow</option>
<option value="background-color:#AFAD00" style="background-color:#AFAD00">Dark Yellow</option>
<option value="background-color:#14D800" style="background-color:#14D800">Light Green</option>
<option value="background-color:#11B700" style="background-color:#11B700">Medium Green</option>
<option value="background-color:#0B7500" style="background-color:#0B7500">Dark Green</option>
<option value="background-color:#0061D8" style="background-color:#0061D8">Light Blue</option>
<option value="background-color:#0038B7" style="background-color:#0038B7">Medium Blue</option>
<option value="background-color:#002975" style="background-color:#002975">Dark Blue</option>
<option value="background-color:#7A00D8" style="background-color:#7A00D8">Light Indigo</option>
<option value="background-color:#6300B7" style="background-color:#6300B7">Medium Indigo</option>
<option value="background-color:#3F0075" style="background-color:#3F0075">Dark Indigo</option>
<option value="background-color:#B200D8" style="background-color:#B200D8">Light Violet</option>
<option value="background-color:#8E00B7" style="background-color:#8E00B7">Medium Violet</option>
<option value="background-color:#5B0075" style="background-color:#5B0075">Dark Violet</option>
  </select>
  
  <br /><br />
        
    Select a Style: <select name="style_" size="1" id="color">
    <option value="">Select One</option>
    <option value="font-weight:bold" style="font-weight:bold">Bold</option>
<option value="font-style:italic" style="font-style:italic">Italic</option>
<option value="text-decoration:overline" style="text-decoration:overline">Overline</option>
<option value="text-decoration:underline" style="text-decoration:underline">Underline</option>
<option value="text-decoration:line-through" style="text-decoration:line-through">Line Through</option>
<option value="text-transform: uppercase" style="text-transform: uppercase">Uppercase</option>
<option value="text-transform: lowercase" style="text-transform: lowercase">Lowercase</option>
  </select>'
;
  
  

    }



    function 
onUse() {

        global 
$db_prefix$ID_MEMBER;

        

        
$result db_query("UPDATE {$db_prefix}members
                            SET shop_nameStyle = 
                                concat(shop_nameStyle,'
{$_POST['style_']}{$_POST['bgcolor_']}{$_POST['color_']}{$_POST['font_']};')
                            WHERE ID_MEMBER = 
{$ID_MEMBER}",
                            
__FILE____LINE__);



        return 
"Successfully updated your display name colors and style!";

    }



}



?>


Offline David

Re: Some Name Alteration Items
« Reply #38 on: April 06, 2007, 04:51:20 am »
Updated Change Font item with more fonts:

Code: [Select]
<?php

/**********************************************\

| SMFSHOP (Shop MOD for Simple Machines Forum) |

|         (c) 2005 DanSoft Australia           |

|      http://www.dansoftaustralia.net/        |

\**********************************************/



//File: Change_Font.php

//This item allows users to change their name font using a drop down menu.


//NOTE: This item requires that the DisplayNameCSS addon item be installed!

//Authors Website: www.graphicaddicts.net


//VERSION: 1.0

//DATE: April 21st 2006



class item_Change_Font extends itemTemplate {

    function 
getItemDetails() {
        
$this->name "Change Name Font!";
        
$this->desc "Change the font of your display name to: Arial, Comic Sans, Courier, Papyrus, Times, Verdana.";
        
$this->price 75;

        
$this->require_input true;
        
$this->can_use_item true;
    }



    function 
getUseInput() {

        return 
'Select a Font: <select name="font_" size="1" id="color">
    <option value="">Select One</option>
    <option value="font-family: Arial" style="font-family: Arial;color:#FFFFFF;background-color:#000000">Arial</option>
    <option value="font-family: Arial Black" style="font-family: Arial Black">Arial Black</option>
<option value="font-family: Arial Narrow" style="font-family: Arial Narrow">Arial Narrow</option>
<option value="font-family: Arial Unicode MS" style="font-family: Arial Unicode MS">Arial Unicode MS</option>
<option value="font-family: Book Antiqua" style="font-family: Book Antiqua">Book Antiqua</option>
<option value="font-family: Bookman Old Style" style="font-family: Bookman Old Style">Bookman Old Style</option>
<option value="font-family: Century Gothic" style="font-family: Century Gothic">Century Gothic</option>
<option value="font-family: Comic Sans MS" style="font-family: Comic Sans MS">Comic Sans MS</option>
<option value="font-family: Courier New" style="font-family: Courier New">Courier New</option>
    <option value="font-family: Garamond" style="font-family: Garamond">Garamond</option>
<option value="font-family: Georgia" style="font-family: Georgia">Georgia</option>
<option value="font-family: Impact" style="font-family: Impact">Impact</option>
<option value="font-family: Lucida Console" style="font-family: Lucida Console">Lucida Console</option>
<option value="font-family: Lucida Sans Unicode" style="font-family: Lucida Sans Unicode">Lucida Sans Unicode</option>
<option value="font-family: Palatino Linotype" style="font-family: Palatino Linotype">Palatino Linotype</option>
<option value="font-family: Papyrus" style="font-family: Papyrus">Papyrus</option>
<option value="font-family: Times New Roman" style="font-family: Times New Roman">Times New Roman</option>
<option value="font-family: Trebuchet MS" style="font-family: Trebuchet MS">Trebuchet MS</option>
<option value="font-family: Verdana" style="font-family: Verdana">Verdana</option>

  </select>'
;

    }



    function 
onUse() {

        global 
$db_prefix$ID_MEMBER;

        

        
$result db_query("UPDATE {$db_prefix}members
                            SET shop_nameStyle = 
                                
                                concat(shop_nameStyle,'
{$_POST['font_']};')
                            WHERE ID_MEMBER = 
{$ID_MEMBER}",
                            
__FILE____LINE__);



        return 
"Successfully updated your display name font!";

    }



}



?>

Offline perplexed

Re: Some Name Alteration Items
« Reply #39 on: April 06, 2007, 04:58:10 am »
thanks - rub it in lol

*wishes mine would work*


update:  I tried it on my other forum and it works!   So I dont know whats wrong with the testforum though I had some problems I posted about in another thread  :D

thanks for fixing the code so that it worked after my pathetic attempt.  I have ideas but just don't know how to code lol
« Last Edit: April 06, 2007, 05:06:47 am by perplexed »
Estne volumen in toga, an solum tibi libet me videre?

Offline David

Re: Some Name Alteration Items
« Reply #40 on: April 06, 2007, 05:49:33 am »
My pleasure...especially when I'm rubbing things in.

 I'm learning as I go as regards coding (have been for quite a few decades on quite a few programming languages...show me anyone who does any coding who isn't in the same boat) and make use of W3 schools quite a bit (especially for php)...you could do worse.

 Anyhow, had you not started the ball rolling I'd not have done some fixes so how about we share the honours?

 Glad it's working on your other forum...at least you got something out of it.

Offline perplexed

Re: Some Name Alteration Items
« Reply #41 on: April 06, 2007, 06:26:19 am »
ok, its a deal :)

I think I might have to reinstall my testforum from backup and start over.  It was probably working all along but the dumb forum wasnt co-operating lol

thanks again
Estne volumen in toga, an solum tibi libet me videre?

Offline Craig!!

Re: Some Name Alteration Items
« Reply #42 on: April 16, 2007, 11:34:17 pm »
What do I name this and where do I put it..?

Really cool Item man!! :)

Offline David

Re: Some Name Alteration Items
« Reply #43 on: April 16, 2007, 11:42:58 pm »
Thanks!

 The names are in the files...the single function one is to be named Change_Font.php and the multiple function one Change_All_2.php

 You put them, like all shop items, in the "Sources/shop/items/ " directory. And use them in the same way as any other shop item. Obviously it would be wise for you to charge more for items that do more but that is for you to set up when arranging the handling of them via the shop admin screens.

 I have now made a further item that extends the functions of the Change_All_2.php by adding control over borders (a rather large selection of different borders)...the file is too big to post here and I can't add it as a zip file because this forum has attachments disabled. If you want it PM me...I may well make a fourth file giving the borders control as a single function. The new file is to be called Change_All_3.php
« Last Edit: April 16, 2007, 11:49:16 pm by David »

Offline Craig!!

Re: Some Name Alteration Items
« Reply #44 on: April 18, 2007, 12:49:00 am »
Ok.. thanks man!! ;D