[DEV] IGN Style Colored Names 2.0

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment!
Scam Warning

Re: [DEV] IGN Style Colored Names 2.0

Postby Peter77sx » Thu Jul 01, 2010 4:30 am

Trel wrote:
Peter77sx wrote:Well... has anyone other then Trel tested this? Trying to figure out why it's not saving the colored styles.

Did you run the installer, did you purge the cache, and did you do all edits to the php files?



Totally forgot about the permissions. :roll:

Works now, thanks. :)
Peter77sx
Registered User
 
Posts: 3072
Joined: Wed Nov 09, 2005 2:51 pm
Location: Michigan
Name: Pete

Re: [DEV] IGN Style Colored Names 2.0

Postby Stitch625 » Sun Jul 04, 2010 5:09 am

Hi Trel,
Is there a way to limit what colors a user can use? Like for example I don't want my users to use Moderator or Admin colors or anything close.
User avatar
Stitch625
Registered User
 
Posts: 683
Joined: Wed Jun 20, 2007 3:38 pm
Location: Michigan

Re: [DEV] IGN Style Colored Names 2.0

Postby WascallyWabbit » Sun Jul 04, 2010 5:50 am

Open: includes/functions_content.php
Find:
Code: Select all
/**
* Generate an option list of color codes and names
*
* @param string $color is the current color in use (the hex code including the number sign)
* @param string $extra_pre is any additional text to be included before the color
* @param string $extra_post is any additional text to be included after the color (used in this mod by default to easily add border styles as well)
*
*/
function generate_color_list($color, $extra_pre="", $extra_post="")
{

    global $user;
    $user->add_lang('mods/colored_names');
    $colorlist = array(
    "transparent" => "{L_USER_COLOR__NONE_}",
    "#F0F8FF" => "{L_USER_COLOR_ALICEBLUE}",
    "#FAEBD7" => "{L_USER_COLOR_ANTIQUEWHITE}",
    "#7FFFD4" => "{L_USER_COLOR_AQUAMARINE}",
    "#F0FFFF" => "{L_USER_COLOR_AZURE}",
    "#F5F5DC" => "{L_USER_COLOR_BEIGE}",
    "#FFE4C4" => "{L_USER_COLOR_BISQUE}",
    "#000000" => "{L_USER_COLOR_BLACK}",
    "#FFEBCD" => "{L_USER_COLOR_BLANCHEDALMOND}",
    "#0000FF" => "{L_USER_COLOR_BLUE}",
    "#8A2BE2" => "{L_USER_COLOR_BLUEVIOLET}",
    "#A52A2A" => "{L_USER_COLOR_BROWN}",
    "#DEB887" => "{L_USER_COLOR_BURLYWOOD}",
    "#5F9EA0" => "{L_USER_COLOR_CADETBLUE}",
    "#7FFF00" => "{L_USER_COLOR_CHARTREUSE}",
    "#D2691E" => "{L_USER_COLOR_CHOCOLATE}",
    "#FF7F50" => "{L_USER_COLOR_CORAL}",
    "#6495ED" => "{L_USER_COLOR_CORNFLOWERBLUE}",
    "#FFF8DC" => "{L_USER_COLOR_CORNSILK}",
    "#DC143C" => "{L_USER_COLOR_CRIMSON}",
    "#00FFFF" => "{L_USER_COLOR_CYAN}",
    "#00008B" => "{L_USER_COLOR_DARKBLUE}",
    "#008B8B" => "{L_USER_COLOR_DARKCYAN}",
    "#B8860B" => "{L_USER_COLOR_DARKGOLDENROD}",
    "#A9A9A9" => "{L_USER_COLOR_DARKGRAY}",
    "#006400" => "{L_USER_COLOR_DARKGREEN}",
    "#BDB76B" => "{L_USER_COLOR_DARKKHAKI}",
    "#8B008B" => "{L_USER_COLOR_DARKMAGENTA}",
    "#556B2F" => "{L_USER_COLOR_DARKOLIVEGREEN}",
    "#FF8C00" => "{L_USER_COLOR_DARKORANGE}",
    "#9932CC" => "{L_USER_COLOR_DARKORCHID}",
    "#8B0000" => "{L_USER_COLOR_DARKRED}",
    "#E9967A" => "{L_USER_COLOR_DARKSALMON}",
    "#8FBC8F" => "{L_USER_COLOR_DARKSEAGREEN}",
    "#483D8B" => "{L_USER_COLOR_DARKSLATEBLUE}",
    "#2F4F4F" => "{L_USER_COLOR_DARKSLATEGRAY}",
    "#00CED1" => "{L_USER_COLOR_DARKTURQUOISE}",
    "#9400D3" => "{L_USER_COLOR_DARKVIOLET}",
    "#FF1493" => "{L_USER_COLOR_DEEPPINK}",
    "#00BFFF" => "{L_USER_COLOR_DEEPSKYBLUE}",
    "#696969" => "{L_USER_COLOR_DIMGRAY}",
    "#1E90FF" => "{L_USER_COLOR_DODGERBLUE}",
    "#D19275" => "{L_USER_COLOR_FELDSPAR}",
    "#B22222" => "{L_USER_COLOR_FIREBRICK}",
    "#FFFAF0" => "{L_USER_COLOR_FLORALWHITE}",
    "#228B22" => "{L_USER_COLOR_FORESTGREEN}",
    "#FF00FF" => "{L_USER_COLOR_MAGENTA}",
    "#DCDCDC" => "{L_USER_COLOR_GAINSBORO}",
    "#F8F8FF" => "{L_USER_COLOR_GHOSTWHITE}",
    "#FFD700" => "{L_USER_COLOR_GOLD}",
    "#DAA520" => "{L_USER_COLOR_GOLDENROD}",
    "#808080" => "{L_USER_COLOR_GRAY}",
    "#008000" => "{L_USER_COLOR_GREEN}",
    "#ADFF2F" => "{L_USER_COLOR_GREENYELLOW}",
    "#F0FFF0" => "{L_USER_COLOR_HONEYDEW}",
    "#FF69B4" => "{L_USER_COLOR_HOTPINK}",
    "#CD5C5C" => "{L_USER_COLOR_INDIANRED}",
    "#4B0082" => "{L_USER_COLOR_INDIGO}",
    "#FFFFF0" => "{L_USER_COLOR_IVORY}",
    "#F0E68C" => "{L_USER_COLOR_KHAKI}",
    "#E6E6FA" => "{L_USER_COLOR_LAVENDER}",
    "#FFF0F5" => "{L_USER_COLOR_LAVENDERBLUSH}",
    "#7CFC00" => "{L_USER_COLOR_LAWNGREEN}",
    "#FFFACD" => "{L_USER_COLOR_LEMONCHIFFON}",
    "#ADD8E6" => "{L_USER_COLOR_LIGHTBLUE}",
    "#F08080" => "{L_USER_COLOR_LIGHTCORAL}",
    "#E0FFFF" => "{L_USER_COLOR_LIGHTCYAN}",
    "#FAFAD2" => "{L_USER_COLOR_LIGHTGOLDENRODYELLOW}",
    "#D3D3D3" => "{L_USER_COLOR_LIGHTGREY}",
    "#90EE90" => "{L_USER_COLOR_LIGHTGREEN}",
    "#FFB6C1" => "{L_USER_COLOR_LIGHTPINK}",
    "#FFA07A" => "{L_USER_COLOR_LIGHTSALMON}",
    "#20B2AA" => "{L_USER_COLOR_LIGHTSEAGREEN}",
    "#87CEFA" => "{L_USER_COLOR_LIGHTSKYBLUE}",
    "#8470FF" => "{L_USER_COLOR_LIGHTSLATEBLUE}",
    "#778899" => "{L_USER_COLOR_LIGHTSLATEGRAY}",
    "#B0C4DE" => "{L_USER_COLOR_LIGHTSTEELBLUE}",
    "#FFFFE0" => "{L_USER_COLOR_LIGHTYELLOW}",
    "#00FF00" => "{L_USER_COLOR_LIME}",
    "#32CD32" => "{L_USER_COLOR_LIMEGREEN}",
    "#FAF0E6" => "{L_USER_COLOR_LINEN}",
    "#800000" => "{L_USER_COLOR_MAROON}",
    "#66CDAA" => "{L_USER_COLOR_MEDIUMAQUAMARINE}",
    "#0000CD" => "{L_USER_COLOR_MEDIUMBLUE}",
    "#BA55D3" => "{L_USER_COLOR_MEDIUMORCHID}",
    "#9370D8" => "{L_USER_COLOR_MEDIUMPURPLE}",
    "#3CB371" => "{L_USER_COLOR_MEDIUMSEAGREEN}",
    "#7B68EE" => "{L_USER_COLOR_MEDIUMSLATEBLUE}",
    "#00FA9A" => "{L_USER_COLOR_MEDIUMSPRINGGREEN}",
    "#48D1CC" => "{L_USER_COLOR_MEDIUMTURQUOISE}",
    "#C71585" => "{L_USER_COLOR_MEDIUMVIOLETRED}",
    "#191970" => "{L_USER_COLOR_MIDNIGHTBLUE}",
    "#F5FFFA" => "{L_USER_COLOR_MINTCREAM}",
    "#FFE4E1" => "{L_USER_COLOR_MISTYROSE}",
    "#FFE4B5" => "{L_USER_COLOR_MOCCASIN}",
    "#FFDEAD" => "{L_USER_COLOR_NAVAJOWHITE}",
    "#000080" => "{L_USER_COLOR_NAVY}",
    "#FDF5E6" => "{L_USER_COLOR_OLDLACE}",
    "#808000" => "{L_USER_COLOR_OLIVE}",
    "#6B8E23" => "{L_USER_COLOR_OLIVEDRAB}",
    "#FFA500" => "{L_USER_COLOR_ORANGE}",
    "#FF4500" => "{L_USER_COLOR_ORANGERED}",
    "#DA70D6" => "{L_USER_COLOR_ORCHID}",
    "#EEE8AA" => "{L_USER_COLOR_PALEGOLDENROD}",
    "#98FB98" => "{L_USER_COLOR_PALEGREEN}",
    "#AFEEEE" => "{L_USER_COLOR_PALETURQUOISE}",
    "#D87093" => "{L_USER_COLOR_PALEVIOLETRED}",
    "#FFEFD5" => "{L_USER_COLOR_PAPAYAWHIP}",
    "#FFDAB9" => "{L_USER_COLOR_PEACHPUFF}",
    "#CD853F" => "{L_USER_COLOR_PERU}",
    "#FFC0CB" => "{L_USER_COLOR_PINK}",
    "#DDA0DD" => "{L_USER_COLOR_PLUM}",
    "#B0E0E6" => "{L_USER_COLOR_POWDERBLUE}",
    "#800080" => "{L_USER_COLOR_PURPLE}",
    "#FF0000" => "{L_USER_COLOR_RED}",
    "#BC8F8F" => "{L_USER_COLOR_ROSYBROWN}",
    "#4169E1" => "{L_USER_COLOR_ROYALBLUE}",
    "#8B4513" => "{L_USER_COLOR_SADDLEBROWN}",
    "#FA8072" => "{L_USER_COLOR_SALMON}",
    "#F4A460" => "{L_USER_COLOR_SANDYBROWN}",
    "#2E8B57" => "{L_USER_COLOR_SEAGREEN}",
    "#FFF5EE" => "{L_USER_COLOR_SEASHELL}",
    "#A0522D" => "{L_USER_COLOR_SIENNA}",
    "#C0C0C0" => "{L_USER_COLOR_SILVER}",
    "#87CEEB" => "{L_USER_COLOR_SKYBLUE}",
    "#6A5ACD" => "{L_USER_COLOR_SLATEBLUE}",
    "#708090" => "{L_USER_COLOR_SLATEGRAY}",
    "#FFFAFA" => "{L_USER_COLOR_SNOW}",
    "#00FF7F" => "{L_USER_COLOR_SPRINGGREEN}",
    "#4682B4" => "{L_USER_COLOR_STEELBLUE}",
    "#D2B48C" => "{L_USER_COLOR_TAN}",
    "#008080" => "{L_USER_COLOR_TEAL}",
    "#D8BFD8" => "{L_USER_COLOR_THISTLE}",
    "#FF6347" => "{L_USER_COLOR_TOMATO}",
    "#40E0D0" => "{L_USER_COLOR_TURQUOISE}",
    "#EE82EE" => "{L_USER_COLOR_VIOLET}",
    "#D02090" => "{L_USER_COLOR_VIOLETRED}",
    "#F5DEB3" => "{L_USER_COLOR_WHEAT}",
    "#FFFFFF" => "{L_USER_COLOR_WHITE}",
    "#F5F5F5" => "{L_USER_COLOR_WHITESMOKE}",
    "#FFFF00" => "{L_USER_COLOR_YELLOW}",
    "#9ACD32" => "{L_USER_COLOR_YELLOWGREEN}",
    );

  $formatted_list = "";
  foreach ($colorlist as $colcode => $colname)
  {
    $tmp = "<option value=\"".$extra_pre.$colcode.$extra_post."\" {SELECTED} style=\"font-weight: bold; color: ".$colcode."; background: #9C9C9C;\">".$colname."</option>\r\n";
    if ($colcode == "clear")
    {
      $tmp = str_replace($extra_pre.$colcode.$extra_post, $colcode, $tmp);
    }
    if ($color == $extra_pre.$colcode.$extra_post or $color == $colcode)
    {
      $formatted_list .= str_replace("{SELECTED}", "selected=\"selected\"", $tmp);
    }
    else
    {
      $formatted_list .= str_replace("{SELECTED}", "", $tmp);
    }
  }
 
  foreach ($user->lang['USER_COLOR_LIST'] as $key => $value)
    {
        $formatted_list = str_replace("{L_".$key."}", $value, $formatted_list);
    }
 
   
  return $formatted_list;
}

/**
* Generate a list of options for use with a select tag
*
* @param string $current is the current value of the option in use (used to set the selected option in the list)
* @param string $options should be an array of the options to be generated
*
*/
function generate_option_list($current, $options)
{
   $list = "";
   foreach ($options as $curopt)
   {
      $sel = "";
      if ($current == $curopt)
      {
         $sel = "selected=\"selected\"";
      }
      $list .= "<option value=\"".$curopt."\" ".$sel.">".ucwords($curopt)."</option>";
   }
   return $list; 
}

and remove or comment out any colors that you don't want available.
WascallyWabbit
Registered User
 
Posts: 170
Joined: Sun Mar 16, 2008 1:17 pm

Re: [DEV] IGN Style Colored Names 2.0

Postby Stitch625 » Sun Jul 04, 2010 1:46 pm

Oh Sweet!

Thanks....That's pretty easy. :)
User avatar
Stitch625
Registered User
 
Posts: 683
Joined: Wed Jun 20, 2007 3:38 pm
Location: Michigan

Re: [DEV] IGN Style Colored Names 2.0

Postby Stitch625 » Sun Jul 04, 2010 8:12 pm

This mod is pretty buggy.

After you select your color and font options then click the submit button there is no change but I have found that if you go back and re-visit your profile, everything updates automatically.

Another problem is that it affects my rank titles, my custom profile field "Real Name" and my custom profile field "status button"

I have attached a snap shot to help better explain.
Image
User avatar
Stitch625
Registered User
 
Posts: 683
Joined: Wed Jun 20, 2007 3:38 pm
Location: Michigan

Re: [DEV] IGN Style Colored Names 2.0

Postby Trel » Mon Jul 05, 2010 3:56 am

Stitch625 wrote:This mod is pretty buggy.

After you select your color and font options then click the submit button there is no change but I have found that if you go back and re-visit your profile, everything updates automatically.

Another problem is that it affects my rank titles, my custom profile field "Real Name" and my custom profile field "status button"

I have attached a snap shot to help better explain.
Image


As for the not updating until reloading the profile page, that has something to do with the cache. I've seen it happen twice and never again. Though someone who had that issue told me that when they manually purged the cache from the main page in the admin panel, it never happened again.

Also as far as your screenshot, I've never seen that happen in any sceario, are you sure all tags are closed in the profile template? It doesn't look like the default skin so I'm not sure how it is happening. Never saw it on any default skin, nor any skin I've installed.

With the problem happening, could you possibly view source and post it here?
User avatar
Trel
Registered User
 
Posts: 507
Joined: Sun Aug 11, 2002 2:02 pm
Location: In your moniter stupid

Re: [DEV] IGN Style Colored Names 2.0

Postby Stitch625 » Mon Jul 05, 2010 4:02 am

I am 99% sure all my tags are closed. The theme is my own custom theme based off of Subsilver. It is pretty much the same coding structure. I have never had to do any custom changes for modding. I will have a close look at the template but I guess I don't quite understand how this mod can affect my CPF fields. :?:

[EDIT] I have checked everything in my template and I do not see anything wrong with it. All tags are closed. I have also refreshed/purged the cache many times and I still have to re-visit the profile for the colored names & style to take affect.
User avatar
Stitch625
Registered User
 
Posts: 683
Joined: Wed Jun 20, 2007 3:38 pm
Location: Michigan

Re: [DEV] IGN Style Colored Names 2.0

Postby Trel » Mon Jul 05, 2010 5:55 am

Stitch625 wrote:I am 99% sure all my tags are closed. The theme is my own custom theme based off of Subsilver. It is pretty much the same coding structure. I have never had to do any custom changes for modding. I will have a close look at the template but I guess I don't quite understand how this mod can affect my CPF fields. :?:

[EDIT] I have checked everything in my template and I do not see anything wrong with it. All tags are closed. I have also refreshed/purged the cache many times and I still have to re-visit the profile for the colored names & style to take affect.


I can't explain the re-visiting part. Are you sure you have to re-visit, will any page load anywhere do it? For instance, will going to the main index also do it?

As far as your custom fields I have no clue, I've had many custom fields and have never seen anything like that. That's why I would like to see the HTML source when the issue is happening so I can figure it out.
User avatar
Trel
Registered User
 
Posts: 507
Joined: Sun Aug 11, 2002 2:02 pm
Location: In your moniter stupid

Re: [DEV] IGN Style Colored Names 2.0

Postby Stitch625 » Mon Jul 05, 2010 7:01 pm

Here ya go Trel,

See for yourself. Here is a test account.

username=test
password=test123

link to my forum is in my sig. Thanks for having a look. ;)
User avatar
Stitch625
Registered User
 
Posts: 683
Joined: Wed Jun 20, 2007 3:38 pm
Location: Michigan

Re: [DEV] IGN Style Colored Names 2.0

Postby Trel » Mon Jul 05, 2010 7:51 pm

Stitch625 wrote:Here ya go Trel,

See for yourself. Here is a test account.

username=test
password=test123

link to my forum is in my sig. Thanks for having a look. ;)

it says it's not a valid account?
But I also looked at the board while logged out, I don't see you having the mod active at all (your name isn't showing as colored at all)
User avatar
Trel
Registered User
 
Posts: 507
Joined: Sun Aug 11, 2002 2:02 pm
Location: In your moniter stupid

Re: [DEV] IGN Style Colored Names 2.0

Postby Stitch625 » Mon Jul 05, 2010 8:13 pm

oops sorry.

The username is
tester

I have enabled the colored names for this account so you can try it out. I it diabled for my name because of the way it is behaving. I will go ahead and enable it so you can see it.
User avatar
Stitch625
Registered User
 
Posts: 683
Joined: Wed Jun 20, 2007 3:38 pm
Location: Michigan

Re: [DEV] IGN Style Colored Names 2.0

Postby Trel » Mon Jul 05, 2010 8:59 pm

Did you do something to make it apply the group colors to the fields where it's affecting?

As far as the part about it not updating until you view the profile again, are you aware that it's cached, and that I have a line in there to destroy the cache, but only after the profile loads again. When you said you had to load, I was not aware that you weren't letting it do the initial load after you submitted the changes.
User avatar
Trel
Registered User
 
Posts: 507
Joined: Sun Aug 11, 2002 2:02 pm
Location: In your moniter stupid

Re: [DEV] IGN Style Colored Names 2.0

Postby Stitch625 » Mon Jul 05, 2010 9:49 pm

Trel wrote:Did you do something to make it apply the group colors to the fields where it's affecting?

No. I have done nothing.
Trel wrote:As far as the part about it not updating until you view the profile again, are you aware that it's cached, and that I have a line in there to destroy the cache, but only after the profile loads again. When you said you had to load, I was not aware that you weren't letting it do the initial load after you submitted the changes.

I know it is cached but I should not have to re-visit the profile to make the changes take affect.

Never mind. I'm just going to uninstall it. You obviously think it is my fault your mod is not working. Instead of looking more into the issue you keep making excuses and pointing the finger at me. How are my users supposed to know to go back to their profile to reload it? This is not right. Nothing in phpBB software behaves this way.
User avatar
Stitch625
Registered User
 
Posts: 683
Joined: Wed Jun 20, 2007 3:38 pm
Location: Michigan

Re: [DEV] IGN Style Colored Names 2.0

Postby Trel » Mon Jul 05, 2010 10:00 pm

Stitch625 wrote:
Trel wrote:Did you do something to make it apply the group colors to the fields where it's affecting?

No. I have done nothing.
Trel wrote:As far as the part about it not updating until you view the profile again, are you aware that it's cached, and that I have a line in there to destroy the cache, but only after the profile loads again. When you said you had to load, I was not aware that you weren't letting it do the initial load after you submitted the changes.

I know it is cached but I should not have to re-visit the profile to make the changes take affect.

Never mind. I'm just going to uninstall it. You obviously think it is my fault your mod is not working. Instead of looking more into the issue you keep making excuses and pointing the finger at me. How are my users supposed to know to go back to their profile to reload it? This is not right. Nothing in phpBB software behaves this way.

First off, I can't replicate any of these problem on a fresh install and I did it two more times to be sure. Second, looking at your board it IS applying group colors to the custom fields, and it doesn't do that by default, so something is up there. Third, believe it or not, the cache is built in, and when it is re-loading the page, it will by default go back to the profile edit page which would satisfy when I destroy the cache. Unless you interrupt that process it works. I have no idea why these things aren't working for you, but they don't occur on a fresh install with the default templates, so I really can't say why they are for you. I can't account for every interaction in everything you change, I can only test against a fresh install.

I mean, here's my demo http://crysic.com/mod_demo/ the only thing I did there is.
1. install board
2. install automod
3. install my mod

If everything is working there, then exactly how am I supposed to assume somethign is wrong with mine?
User avatar
Trel
Registered User
 
Posts: 507
Joined: Sun Aug 11, 2002 2:02 pm
Location: In your moniter stupid

Re: [DEV] IGN Style Colored Names 2.0

Postby Stitch625 » Mon Jul 05, 2010 11:23 pm

Yea Trel you are correct.I am applying the group colors to the ranks and real name Custom fields. I suppose that could have some conflict but the "Status button doesn't make any sense. I just wish I could find a work-around to make your mod work.

This is the code I am using for my ranks and Real Name CPF's
Code: Select all
<b class="genmed"<!-- IF postrow.POST_AUTHOR_COLOUR -->><span style="color: {postrow.POST_AUTHOR_COLOUR}"<!-- ENDIF -->><i>{postrow.PROFILE_REAL_NAME_VALUE}</b></i></span>

It is a fairly innocent piece of code.
User avatar
Stitch625
Registered User
 
Posts: 683
Joined: Wed Jun 20, 2007 3:38 pm
Location: Michigan

PreviousNext

Return to [3.0.x] MODs in Development

Who is online

Users browsing this forum: forforce, godd1, omgili [Bot] and 33 guests