Post Reply 
Need help with php
Plugin->Zinga's plugin username colors
Author Message
ZiNgA BuRgA
Smart Alternative

Posts: 17,024.1882
Threads: 1,174
Joined: 19th Jan 2007
Reputation: -1.71391
E-Pigs: 446.1887
Offline
Post: #5
RE: Need help with php
Firstly, the code you supplied is rather illogical and obviously doesn't work...
Secondly, it's very inefficient - you make a query every time you have to format a name - for example, if there's 100 names needing to be formatted, your code queries the database 100 times just to do that.
My method hardly affects speed, but to achieve that, a lot of code edits are needed.

I'll point out some problems with your script, however, I'm not going to provide you with a full solution (since it won't be "good" anyway):

PHP Code:
    $query = $db->simple_select(TABLE_PREFIX."userfields", "fid5", "ufid='".intval($uid)."'");


  1. The query isn't used anywhere
  2. $uid is not initialized, and means nothing

The rest looks like it will work.

Pirata Nervo Wrote:Updated with a new question as i resolved my other problem.
Also zinga changed the php code i don't know why but its:

            $ugroup = $groupscache[$usergroup];
            $format = "<span style=\"color:{$userfields['fid5']};\">{username}</span>";
            $userin = substr_count($format, "{username}");

not

            $ugroup = $groupscache[$usergroup];
            $format = "<span style=\"color:{$userfields['fid5']};\">{username}</span>";
            $userin = substr_count($format, "{username}");
What???
07/09/2007 09:10 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply 


Messages In This Thread
Need help with php - Pirata Nervo - 07/09/2007, 07:13 AM
RE: Need help with php - Th3_Hellrider - 07/09/2007, 08:52 AM
RE: Need help with php - Pirata Nervo - 07/09/2007, 09:12 AM
RE: Need help with php - Pirata Nervo - 07/09/2007, 03:36 PM
RE: Need help with php - ZiNgA BuRgA - 07/09/2007 09:10 PM
RE: Need help with php - Pirata Nervo - 08/09/2007, 12:45 AM
RE: Need help with php - Pirata Nervo - 08/09/2007, 05:58 AM
RE: Need help with php - ZiNgA BuRgA - 08/09/2007, 07:11 PM
RE: Need help with php - Pirata Nervo - 09/09/2007, 02:25 AM
RE: Need help with php - ZiNgA BuRgA - 09/09/2007, 05:10 AM
RE: Need help with php - Pirata Nervo - 09/09/2007, 06:09 AM
RE: Need help with php - ZiNgA BuRgA - 09/09/2007, 06:12 PM
RE: Need help with php - Pirata Nervo - 10/09/2007, 02:38 AM
RE: Need help with php - ZiNgA BuRgA - 10/09/2007, 03:07 AM
RE: Need help with php - Pirata Nervo - 10/09/2007, 03:24 AM
RE: Need help with php - Pirata Nervo - 10/09/2007, 02:53 PM
RE: Need help with php - ZiNgA BuRgA - 10/09/2007, 04:12 PM
RE: Need help with php - Pirata Nervo - 11/09/2007, 01:41 AM
RE: Need help with php - ZiNgA BuRgA - 11/09/2007, 03:54 AM
RE: Need help with php - Pirata Nervo - 11/09/2007, 04:00 AM
RE: Need help with php - Pirata Nervo - 11/09/2007, 04:20 AM
RE: Need help with php - Pirata Nervo - 11/09/2007, 04:05 PM
RE: Need help with php - ZiNgA BuRgA - 11/09/2007, 08:50 PM
RE: Need help with php - Pirata Nervo - 12/09/2007, 01:43 AM
RE: Need help with php - Pirata Nervo - 12/09/2007, 07:36 AM
RE: Need help with php - ZiNgA BuRgA - 12/09/2007, 03:32 PM
RE: Need help with php - Pirata Nervo - 12/09/2007, 03:55 PM
RE: Need help with php - ZiNgA BuRgA - 12/09/2007, 04:11 PM
RE: Need help with php - Pirata Nervo - 12/09/2007, 04:22 PM
RE: Need help with php - Pirata Nervo - 17/09/2007, 01:16 PM
RE: Need help with php - ZiNgA BuRgA - 17/09/2007, 04:57 PM
RE: Need help with php - Pirata Nervo - 18/09/2007, 01:40 AM

Forum Jump:


User(s) browsing this thread: 1 Guest(s)

 Quick Theme: