Post Reply 
Need help with php
Plugin->Zinga's plugin username colors
Author Message
Pirata Nervo
NervOS Developer

Posts: 699.4765
Threads: 39
Joined: 20th Jun 2007
Reputation: -0.79225
E-Pigs: 19.2466
Offline
Post: #11
RE: Need help with php
well the member.php has the $usefields varaible, and i can use the $userfields variable there without doing anything i just need to do what i did in my code.

Like this per example:
Replace this:

PHP Code:
$formattedname = format_name($memprofile['username'], $memprofile['usergroup'], $memprofile['displaygroup']); 


with this:

PHP Code:
1
2
3
4
5
6
7
8
    if($userfields['fid5'])
    {
        $formattedname = "<span style=\"color:{$userfields['fid5']}\">{$memprofile['username']}</span>";
    }
    else
    {
        $formattedname = format_name($memprofile['username'], $memprofile['usergroup'], $memprofile['displaygroup']);
    } 


So this is my function now:

PHP Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
function format_namePN($username, $usergroup, $displaygroup="")
{
    global $groupscache, $cache, $db;
	
	$query = $db->simple_select("SELECT * FROM userfields");
    $userfields = $db->fetch_field($query);

    if(!is_array($groupscache))
    {
        $groupscache = $cache->read("usergroups");
    }

    if($displaygroup != 0)
    {
        $usergroup = $displaygroup;
    }

    if($userfields['fid5')
    {
        $format = "<span style=\"${userfields['fid5'};\">{username}</span>";
    }
    else
    {
        $ugroup = $groupscache[$usergroup];
        $format = $ugroup['namestyle'];
    }
    $userin = substr_count($format, "{username}"); // function that counts how many times {username} substring is in the $formats string
    if($userin == 0) // if {username} substring wasnt found in the $format string, then
    {
		$format = "{username}"; // the $format string = "{username}"
    }
    $format = stripslashes($format); // The stripslashes() function removes backslashes from the $format string
    return str_replace("{username}", $username, $format); // replaces {username} with $username, so the $format string will contain $username instead of {username}
} 


Still not working.

And its  $format = "<span style=\"${userfields['fid5'};\">{username}</span>"; not  with &#092


(This post was last modified: 09/09/2007 06:10 AM by Pirata Nervo.)
09/09/2007 06:09 AM
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: