Hi,
I tried to make special ranks work but I don't know enough php to do that.
The code posted somewhere in this topics fetches the rank by number of posts so it'll never work for special ranks. Therefore, my ideia is to fetch the rank by userid and rank_id.
I did this:
[code:1] $query = 'SELECT r.' . $_CB_database->NameQuote( 'rank_title' )
. ', r.' . $_CB_database->NameQuote( 'rank_image' )
. ', r.' . $_CB_database->NameQuote( 'rank_id' )
. ', u.' . $_CB_database->NameQuote( 'userid' )
. ', u.' . $_CB_database->NameQuote( 'rank' )
. "\n FROM " . $_CB_database->NameQuote( '#__' . $forum->prefix . '_ranks' ). 'AS r'
. "\n AND " . $_CB_database->NameQuote( '#__' . $forum->prefix . '_users' ). 'AS u'
. "\n WHERE u." . $_CB_database->NameQuote( 'userid' ) . ' = ' . (int) $user->id
. "\n AND u." . $_CB_database->NameQuote( 'rank' ) . ' = r.' . $_CB_database->NameQuote( 'rank_id' )
;[/code:1]
But now the ranks are not appearing in the profile. What's wrong with the code? What's the error?
I knew how to pick up data from the db in SMF but since I moved on to Joomla nothing I do really works as I planned to
So, I'm trying to learn a bit
If someone could help me, i would be very grateful
(sorry for my English by the way)