Post Reply 
Username colours and fonts
Just need one thing to finish it
Author Message
Pirata Nervo
NervOS Developer

Posts: 699.4765
Threads: 39
Joined: 20th Jun 2007
Reputation: -0.79225
E-Pigs: 19.2466
Offline
Post: #1
Username colours and fonts
I decided to create this again, I think it's the same way Zinga uses.
I created 2 columns in the users table.
one for open tags and one for close (I know zinga uses only one :P).

I changed the user cp templates and created the do_format and format actions. (usercp.php)

It is for MyBB 1.4.

I also added the ability to have bold, strike, etc

The update queries(for the 2 columns) from the user cp work perfectly.

(only one theme works with the template right now)

But I am stuck in the format_name function.
here's mine:

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
function format_name($username, $usergroup, $displaygroup="", $pformat, $aformat)
{
	global $groupscache, $cache;


	if(!is_array($groupscache))
	{

		$groupscache = $cache->read("usergroups");
	}



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


	$ugroup = $groupscache[$usergroup];
	$format = $ugroup['namestyle'];
	$userin = substr_count($format, "{username}");


	if($userin == 0)
	{
		$format = $pformat."{username}".$aformat;
	}

	$format = stripslashes($format);

	return str_replace("{username}", $username, $format);
}


I have been practicing PHP, HTML and CSS :P I also made a module for my plaza but did not released it, I may release it once zinga updates my plaza. I also need to update my module.

This is specially directed to zinga.
But everyone who wants to help is welcomed.
thank you

Note: i don't get any errors but the formatting does not work.
I don't know if the problem is that function. IN the shoutbox, I added the pformat and aformat fields in the select query. ANd then changed this:
$row['username'] = format_name($row['username'], $row['usergroup'], $row['displaygroup']);
to:
$row['username'] = format_name($row['username'], $row['usergroup'], $row['displaygroup'], $row['pformat'], $row['aformat']);

select query:
$query = $db»query("SELECT s.*, u.username, u.usergroup, u.displaygroup FROM ".TABLE_PREFIX."sf_shouts s LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid = s.uid) WHERE s.id>{$last_id} ORDER by s.id DESC LIMIT {$mybb»settings[sf_sb_shouts_main]}");


14/08/2008 04:26 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply 


Messages In This Thread
Username colours and fonts - Pirata Nervo - 14/08/2008 04:26 PM
RE: Username colours and fonts - MaDc0w - 14/08/2008, 05:20 PM
RE: Username colours and fonts - feinicks - 14/08/2008, 09:02 PM

Forum Jump:


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

 Quick Theme: