different "stars" based on gender

Started by charlottezweb, November 24, 2003, 12:56:52 PM

Previous topic - Next topic

charlottezweb

My board suggested that they would like the stars for the different posting levels to be colorized based on gender (instead of enabling the sex symbols).  How difficult would that be to mod or integrate?

Regards,
Jason

Fizzy

I managed to get yabbse to recognise the difference between male and female gods (gods and godesses) automatically but I don't know about SMF though.
It would be nice if it did :)
"Reality is merely an illusion, albeit a very persistent one." - A.E.


Spaceman-Spiff

probably you'll only need to edit a few lines of code in the source
example in YSE:
edit Load.php, search for    /* create the memberinfo and memberstars entries */add before:   if ($userprofile[$user]['gender'] == 'Female')
      $memberstar = 'f-star.gif';
   elseif ($userprofile[$user]['gender'] == 'Male')
      $memberstar = 'm-star.gif';
   else
      $memberstar = 'star.gif';

then just replace every star.gif in the lines below it with $memberstar

charlottezweb

Woah, that was pretty straightforward, thanks!  I'll give that a try tonight or tomorrow and let you know if that works (on my YSE install at least).

Thanks,
Jason

charlottezweb

I'm getting this error:

Quote
Fatal error: Cannot use assign-op operators with overloaded objects nor string offsets in /home/*******/public_html/yabbse/Sources/Load.php on line 404

here's the code I used from your instructions -- maybe I made a stupid error?

Quoteif ($userprofile[$user]['gender'] == 'Female')
      $memberstar = 'f-star.gif';
   elseif ($userprofile[$user]['gender'] == 'Male')
      $memberstar = 'm-star.gif';
   else
      $memberstar = 'star.gif';



   /* create the memberinfo and memberstars entries */

   if ($userprofile[$user]['posts'] > $GodPostNum)

   {

      $memberinfo[$user] = "$membergroups[6]";

      $memberstar[$user] = "<img src=\"$memberstar\" border=\"0\" alt=\"*\" /><img src=\"$memberstar\" border=\"0\" alt=\"*\" /><img src=\"$memberstar\" border=\"0\" alt=\"*\" /><img src=\"$memberstar\" border=\"0\" alt=\"*\" /><img src=\"$memberstar\" border=\"0\" alt=\"*\" />";

   }

   elseif ($userprofile[$user]['posts'] > $SrPostNum)

   {

      $memberinfo[$user] = "$membergroups[5]";

      $memberstar[$user] = "<img src=\"$memberstar\" border=\"0\" alt=\"*\" /><img src=\"$memberstar\" border=\"0\" alt=\"*\" /><img src=\"$memberstar\" border=\"0\" alt=\"*\" /><img src=\"$memberstar\" border=\"0\" alt=\"*\" />";

   }

   elseif ($userprofile[$user]['posts'] > $FullPostNum)

   {

      $memberinfo[$user] = "$membergroups[4]";

      $memberstar[$user] = "<img src=\"$memberstar\" border=\"0\" alt=\"*\" /><img src=\"$memberstar\" border=\"0\" alt=\"*\" /><img src=\"$memberstar\" border=\"0\" alt=\"*\" />";

   }

   elseif ($userprofile[$user]['posts'] > $JrPostNum)

   {

      $memberinfo[$user] = "$membergroups[3]";

      $memberstar[$user] = "<img src=\"$memberstar\" border=\"0\" alt=\"*\" /><img src=\"$memberstar\" border=\"0\" alt=\"*\" />";

   }

   else

   {

      $memberinfo[$user] = "$membergroups[2]";

      $memberstar[$user] = "<img src=\"$memberstar\" border=\"0\" alt=\"*\" />";

   }


All I did was replace wherever the star.gif was with the function.  Is there something wrong with my syntax?

Thanks,
Jason

Gobalopper

I think it might be because you are using $memberstar as both an array and as a string.

Advertisement: