phpBB.com     phpBB Academy     phpBB Modders     phpBB Weekly     ktuk     phpBB Hacks     Vlad Studio  

Show style in profile

Shows the style a user is currently using on their profile page.

Not enough for a full proper MOD, but too useful not to share
Forum rules
Please read over our forum guidelines

Show style in profile

Postby kenny » 20 Jan 2009, 13:44

Following on from this topic and from a request here, this snippet shows the style a user is currently using on their profile page.

OPEN: memberlist.php
FIND:
Code: Select all
        $template->assign_vars(array(
            'L_POSTS_IN_QUEUE'    => $user->lang('NUM_POSTS_IN_QUEUE', $member['posts_in_queue']), 

BEFORE ADD:
Code: Select all
        // Grab the users style
        $user_style_id = $member['user_style'];
        $style_sql = 'SELECT style_name
            FROM '
 . STYLES_TABLE . "
            WHERE style_id = $user_style_id"
;
        $style_result = $db->sql_query($style_sql);
        while ($style_row = $db->sql_fetchrow($style_result))
        {
            $user_style = $style_row['style_name'];
        }
        $db->sql_freeresult($style_result);   

FIND:
Code: Select all
            'SEARCH_IMG'        => $user->img('icon_user_search', $user->lang['SEARCH']), 

AFTER ADD:
Code: Select all
            'USER_STYLE'            => $user_style

OPEN: language/en/memberlist.php
FIND:
Code: Select all
    'SORT_POST_COUNT'        => 'Post count', 

AFTER ADD:
Code: Select all
    'STYLE'        => 'Style', 

OPEN: styles/YOUR_STYLE/templates/memberlist_view.html
FIND:
Code: Select all
      <!-- IF S_GROUP_OPTIONS --><dt>{L_USERGROUPS}:</dt> <dd><select name="g">{S_GROUP_OPTIONS}</select> <input type="submit" name="submit" value="{L_GO}" class="button2" /></dd><!-- ENDIF -->

AFTER ADD:
Code: Select all
      <!-- IF USER_STYLE --><dt>{L_STYLE}:</dt> <dd>{USER_STYLE}</dd><!-- ENDIF -->
|| 6 String Romance || Myspace || phpBB.com || Need Freelance Work? ||
If you need one of my MODs installed - click here


Are you a musician in the Glasgow area interested in acoustic events? The ArtBox
User avatar
kenny kenny is probably rawking out on RockBand \m/
Project Leader
Project Leader
 
Posts: 647
Joined: 06 Jun 2008, 11:38
Location: Airdrie, UK

Donate to 6 String MODs
If you like any of the work that I do here, please consider donating.
click the image on the left for a list of some of the advantages of donating



Show style in profile

Postby Anyasha » 01 Sep 2009, 08:07

Code: Select all
'USER_STYLE'            => $user_style


needs to be

Code: Select all
'USER_STYLE'            => $user_style,
User avatar
Anyasha
Registered User
Registered User
 
Posts: 3
Joined: 31 Aug 2009, 05:23

Show style in profile

Postby kenny » 01 Sep 2009, 08:24

Ah, thanks for spotting that. Now updated :)
|| 6 String Romance || Myspace || phpBB.com || Need Freelance Work? ||
If you need one of my MODs installed - click here


Are you a musician in the Glasgow area interested in acoustic events? The ArtBox
User avatar
kenny kenny is probably rawking out on RockBand \m/
Project Leader
Project Leader
 
Posts: 647
Joined: 06 Jun 2008, 11:38
Location: Airdrie, UK

Show style in profile

Postby noth » 18 Jun 2010, 08:19

Joined: 12 May 2010 07:00 pm
Member No: 6093
Template: 5
Last visited: 17 Jun 2010 04:34 pm
Warnings: 0
[ View user notes | Warn user ]
Total posts: 31
[0.05% of all posts / 0.84 posts per day]
Search user’s posts
Most active forum: Applications


oooeeerrr I am getting a NUMBER not a style name

what have I done wrong? :(
User avatar
noth
Registered User
Registered User
 
Posts: 36
Joined: 30 Nov 2008, 16:58

Show style in profile

Postby kenny » 18 Jun 2010, 10:38

That shouldn't happen. The code specifically picks out the style_name from the database :?
|| 6 String Romance || Myspace || phpBB.com || Need Freelance Work? ||
If you need one of my MODs installed - click here


Are you a musician in the Glasgow area interested in acoustic events? The ArtBox
User avatar
kenny kenny is probably rawking out on RockBand \m/
Project Leader
Project Leader
 
Posts: 647
Joined: 06 Jun 2008, 11:38
Location: Airdrie, UK




Return to Code Snippets

Who is online

MSN [Bot], Yahoo [Bot]


cron