|
|
| |
Forums ⇒ DragonflyCMS ⇒ Add-Ons & Blocks ⇒ Multirank module w/ forumspro??
Multirank module w/ forumspro??Need help creating a block or add-on, or you have created or modified a block/add-on that works in Dragonfly CMS and it meets the CPG Security Requirements? Do you have feedback about a specific add-on? Here is the place to post. Read the announcements here first!.
Go to page Previous 1, 2
|
View previous topic :: View next topic |
| Author |
Message |
Heckler Heavy poster


Offline Joined: Apr 22, 2007 Posts: 299 Location: California
|
Posted: Sun Aug 19, 2007 7:04 am Post subject: Re: Multirank module w/ forumspro?? |
|
Yeah I know, I just used the insert function in phpMyadmin thou.
Wasn't sure what to name the the .txt file  LOL, I guess any name would work, wouldn't it??
_________________ Phone Rumors | My Solution Manuals | My Online Money Guide | Premium WordPress Themes
Heckler's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS) Linux / 1.3.37 (Unix) / 4.1.21-standard / 4.4.6 / 9.2.1
|
|
| Back to top |
|
 |
Bedevere Nice poster


Offline Joined: Jul 06, 2006 Posts: 83 Location: New York City
|
Posted: Sun Aug 19, 2007 8:15 am Post subject: Re: Multirank module w/ forumspro?? |
|
A text file with an .sql extension
Bedevere's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
|
|
| Back to top |
|
 |
NanoCaiordo Developer


Offline Joined: Jun 29, 2004 Posts: 3878 Location: Melbourne, AU
|
Posted: Sun Aug 19, 2007 8:23 am Post subject: Re: Multirank module w/ forumspro?? |
|
Bedevere at least can you see how admin -> users -> users fields works?
I'm asking you this because what you are doing is not the correct way. In other words I'm inviting you to understand the system clearing out possible problems.
_________________ .:: I met php the 03 December 2003 :: Unforgettable day! ::.
Linux 64bit / Apache 2.2 / PHP 5.4 / MySQL 5.5.22 / v9, v10
Linux 32bit / Apache 2.2 / PHP 5.3.10 / MySQL 5.5.22 / v9, v10
Windows 64bit / IIS 7.5 / PHP 5.3.10 / MySQL 5.5.22 / v9, v10
NanoCaiordo's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS) mixed
|
|
| Back to top |
|
 |
Bedevere Nice poster


Offline Joined: Jul 06, 2006 Posts: 83 Location: New York City
|
Posted: Mon Aug 20, 2007 5:16 pm Post subject: Re: Multirank module w/ forumspro?? |
|
| NanoCaiordo wrote: |
Bedevere at least can you see how admin -> users -> users fields works?
I'm asking you this because what you are doing is not the correct way. In other words I'm inviting you to understand the system clearing out possible problems. |
I assume your talking about Administration Menu › Members Config > Fields > Custom Fields?
Or am I misunderstanding what your talking about?
Bedevere's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
|
|
| Back to top |
|
 |
Bedevere Nice poster


Offline Joined: Jul 06, 2006 Posts: 83 Location: New York City
|
Posted: Mon Aug 20, 2007 9:13 pm Post subject: Re: Multirank module w/ forumspro?? |
|
User field mod....This is for the default bbForums, not ForumsPro
My guild plays multiple games and no one can keep track of who they hell they are. So we figured it would be nice to let people put their character names into a field that displays when they post.
Go to Administration Menu › Members Config > Fields > Custom Fields and create some fields. Note that Field Names is the name it uses to add the field to the mySQL. The description is the display title says. I made all of mine 255 Text (one could possible hack it and make blob fields).
My field names are: gw_character, wow_character, swg_character, vg_character (For Guildwars, WoW, SWG and Vanguard).
Well you edit the SQL lookups to find these fields. So we are going to open modules/forums/viewtopic.php and find:
| Code:: |
if (isset($userinfo['server_specs'])){ |
In this section are two SQL lookups that start with
| Code:: |
$sql = "SELECT u.username, u.user_id, |
In these lines we are going to add the fields we created. To make it neat I added them in this part:
| Code:: |
u.user_interests, p.*, |
So it reads:
| Code:: |
u.user_interests, u.swg_characters, u.wow_characters, u.gw_characters, u.vg_characters, p.*, |
Now we convert the user data to a variable. Find:
| Code:: |
//$skype_img = ( $postrow[$i]['user_skype'] ) ? '<a href="callto://' . $postrow[$i]['user_skype'] .'"><img src="' . $images['icon_skype'] . '" alt="Skype" title="Skype" border="0" /></a>' : '';
//$skype = ( $postrow[$i]['user_skype'] ) ? '<a href="callto://' . $postrow[$i]['user_skype'] .'">Skype</a>' : '';
|
and BEFORE this put:
| Code:: |
if ( !empty($postrow[$i]['swg_characters']) ) {
$swg_character = '<b>SWG:</b> ' . $postrow[$i]['swg_characters'] . '<BR><BR>';
} else {
$swg_character = '';
}
if ( !empty($postrow[$i]['wow_characters']) ) {
$wow_character = '<b>WOW:</b> ' . $postrow[$i]['wow_characters'] . '<BR><BR>';
} else {
$wow_character = '';
}
if ( !empty($postrow[$i]['gw_characters']) ) {
$gw_character = '<b>GW:</b> ' . $postrow[$i]['gw_characters'] . '<BR><BR>';
} else {
$gw_character = '';
}
if ( !empty($postrow[$i]['vg_characters']) ) {
$vg_character = '<b>VG:</b> ' . $postrow[$i]['vg_characters'] . '<BR><BR>';
} else {
$vg_character = '';
} |
Now we give the variable a template name. Look up
| Code:: |
'POSTER_JOINED' => $poster_joined,
'POSTER_POSTS' => $poster_posts,
|
and before it put:
| Code:: |
// Start Game Names
'POSTER_WOW' => $wow_character,
'POSTER_SWG' => $swg_character,
'POSTER_GW' => $gw_character,
'POSTER_VG' => $vg_character,
// End Game Names
|
close and save your file.
Now we need to put the fields into the template. In themes/[Your theme]/template/forums/view_topic.html
I basically put the poster location and post numbers into a table but you can add this anywhere in here.
| Code:: |
<table width="100%">
<tr>
<td valign="top">
<span class="postdetails">
<br />
{postrow.POSTER_WOW}
{postrow.POSTER_SWG}
{postrow.POSTER_VG}
{postrow.POSTER_GW}
<br />
</span>
</td>
</tr>
<tr>
<td valign="Bottom">
<span class="postdetails">
<br />
{postrow.POSTER_JOINED}<br />
{postrow.POSTER_POSTS}<br />
<br />
</span>
</td>
</tr>
</table>
|
Bedevere's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
|
|
| Back to top |
|
 |
ujcogtha Nice poster


Offline Joined: Mar 09, 2006 Posts: 56
|
Posted: Fri Oct 12, 2007 11:56 am Post subject: Re: Multirank module w/ forumspro?? |
|
k i tried using this on the latest version of Dragonfly and it didn't work...there was no view_topic.html file to edit...
_________________ {signature oversize}
ujcogtha's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS) Debian GNU/Linux / Apache 2.0.54 / mysql Ver 14.7 Distrib 4.1.11, for pc-linux-gnu (i386) / PHP 4.3.10-16 / Dragonfly v9.1.2.1
|
|
| Back to top |
|
 |
Heckler Heavy poster


Offline Joined: Apr 22, 2007 Posts: 299 Location: California
|
|
| Back to top |
|
 |
Kinsman Dragonfly addicted


Offline Joined: May 29, 2006 Posts: 343 Location: Australia
|
Posted: Mon May 03, 2010 6:15 am Post subject: Re: Multirank module w/ forumspro?? |
|
Thanks to these excellent instructions I have this working now.
Anybody tried getting the ranks to display elsewhere, like on the Profile Pages?
Kinsman's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS) 2.6.18-164.11.1.el5xen/2.2.13/5.0.89-community-log/5.2.11/9.3.3.0
|
|
| Back to top |
|
 |
Kinsman Dragonfly addicted


Offline Joined: May 29, 2006 Posts: 343 Location: Australia
|
Posted: Mon May 03, 2010 1:51 pm Post subject: Re: Multirank module w/ forumspro?? |
|
Figured it out, happy to post the code if anyone needs it.
Kinsman's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS) 2.6.18-164.11.1.el5xen/2.2.13/5.0.89-community-log/5.2.11/9.3.3.0
|
|
| Back to top |
|
 |
greenday2k Forum Admin


Offline Joined: Aug 11, 2005 Posts: 489 Location: CO
|
|
| Back to top |
|
 |
Kinsman Dragonfly addicted


Offline Joined: May 29, 2006 Posts: 343 Location: Australia
|
Posted: Mon May 03, 2010 9:44 pm Post subject: Re: Multirank module w/ forumspro?? |
|
Ok, I use Accounts Plus and Forums Pro 2 though, so take it with a grain of salt and adapt for your purposes.
Themes/YourTheme/template/account/usernfo.html
Under:
| Code:: |
<tr>
<td valign="middle" align="right"><span class="gen">_(RANK):</span></td>
<td><b><span class="gen">{S_USER_RANK}</span></b></td>
</tr> |
Add:
| Code:: |
<tr>
<td valign="middle" align="right"><span class="gen">_(RANK2):</span></td>
<td><b><span class="gen">{S_USER_RANK2}</span></b></td>
</tr> |
For the Language goto Language/yourlanguage/your_account.php
Under:
| Code:: |
define('_RANK','Rank'); |
Add:
| Code:: |
define('_RANK2','Rank 2'); |
in Modules/YourAccout/userinfo.php
Under:
| Code:: |
if ($userinfo['user_rank']) {
$sql = 'rank_id = '.$userinfo['user_rank'].' AND rank_special = 1';
} else {
$sql = 'rank_min <= '.intval($userinfo['user_posts']).' AND rank_special = 0 ORDER BY rank_min DESC';
}
list($poster_rank, $rank_image) = $db->sql_ufetchrow('SELECT rank_title, rank_image FROM '.$prefix.'_bbranks
WHERE '.$sql, SQL_NUM);
$poster_rank = ($rank_image) ? '<img src="'.$rank_image.'" alt="'.$poster_rank.'" title="'.$poster_rank.'" />' : $poster_rank; |
Add:
| Code:: |
if ($userinfo['user_rank2']) {
$sql = 'rank_id = '.$userinfo['user_rank2'].' AND rank_special = 1';
} else {
$sql = 'rank_min <= '.intval($userinfo['user_posts']).' AND rank_special = 0 ORDER BY rank_min DESC';
}
list($poster_rank2, $rank_image) = $db->sql_ufetchrow('SELECT rank_title, rank_image FROM '.$prefix.'_bbranks
WHERE '.$sql, SQL_NUM);
$poster_rank2 = ($rank_image) ? '<img src="'.$rank_image.'" alt="'.$poster_rank2.'" title="'.$poster_rank2.'" />' : $poster_rank2; |
and Under:
| Code:: |
'S_USER_RANK' => $poster_rank, |
Add:
| Code:: |
'S_USER_RANK2' => $poster_rank2, |
I also moved Offline/Online to the user details cell to save a bit of space.
themes/yourtemplate/templates/forumspro/posts_lists.html
| Code:: |
<td class="row1" width="100%" height="28" valign="bottom" nowrap="nowrap">
<div>
<!-- IF post.B_WHOS_ONLINE_NOT_HIDDEN -->
<!-- IF post.B_WHOS_ONLINE_ONLINE -->
<img src="{I_USER_ONLINE}" alt="{L_USER_ONLINE}" title="{L_USER_ONLINE}" />
<!-- ELSE -->
<img src="{I_USER_OFFLINE}" alt="{L_USER_OFFLINE}" title="{L_USER_OFFLINE}" />
<!-- ENDIF -->
<!-- ENDIF -->
<!-- BEGIN user_details -->
<a href="{post.user_details.U_LINK}" title="{post.user_details.L_TITLE}" <!-- IF post.user_details.B_TARGET -->target="_blank" <!-- ENDIF -->><img src="{S_THEME_PATH}/images/forumspro/{S_LANGUAGE}/user/{post.user_details.U_IMAGE}.gif" alt="{post.user_details.L_TITLE}" title="{post.user_details.L_TITLE}" border="0" /></a><!-- IF post.user_details.B_IMAGE_2 --><a href="{post.user_details.U_LINK_2}" title="{post.user_details.L_TITLE_2}" <!-- IF post.user_details.B_TARGET_2 -->target="_blank" <!-- ENDIF -->><img src="{S_THEME_PATH}/images/forumspro/{S_LANGUAGE}/user/{post.user_details.U_IMAGE_2}.gif" alt="{post.user_details.L_TITLE_2}" title="{post.user_details.L_TITLE_2}" border="0" /></a><!-- ENDIF -->
<!-- END user_details -->
</div>
</td> |
There, I think thats the gist of it.
Kinsman's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS) 2.6.18-164.11.1.el5xen/2.2.13/5.0.89-community-log/5.2.11/9.3.3.0
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You cannot download files in this forum
|
| |
 |
 Welcome Anonymous
|
|
|
|