Forum Replies Created
-
In reply to: profile_menu doesnt work on all pages
K , thanks thomasklaiber , i ill create a new plugin so i don’t lose the changes on a specific update
PS : i am from Morroco , but i can speak French , German , English …
In reply to: profile_menu doesnt work on all pagesOk the problem is solved by using this function instead of the default profile_menu :
function profile_menu() {
global $bb, $bbdb, $bb_current_user, $user_id, $profile_menu, $self, $profile_page_title, $bb_table_prefix;
$user_id=(isset($user_id)) ? $user_id : $bb_current_user->ID;
$list = "<ul id='profile-menu'>";
$list .= "nt<li" . ( ( $self ) ? '' : ' class="current"' ) . '><a href="' . get_user_profile_link( $user_id ) . '">' . __('Profile') . '</a></li>';
if ( isset( $profile_menu ) ) :
foreach ($profile_menu as $item) {
// 0 = name, 1 = users cap, 2 = others cap, 3 = file
$class = '';
if ( $item[3] == $self ) {
$class = ' class="current"';
$profile_page_title = $item[0];
}
if ( can_access_tab( $item, $bb_current_user->ID, $user_id ) )
if ( file_exists($item[3]) || function_exists($item[3]) )
$list .= "nt<li$class><a href='" . wp_specialchars( get_profile_tab_link($user_id, $item[0]) ) . "'>{$item[0]}</a></li>";
}
endif;
$list .= "n</ul>";
echo $list;
}
In reply to: Plugin Request: Forum Categories..Ok if my PHP/MySQL knowledge is still good , the plugin must , on the first use , add a new collumn to bb_topics table ( named for example cat_id ) , and a new table titled bb_cats .
On each use of the plugin , it must check if everything is good ( the collumn cat_id , the table bb_cats ) before continuing , and if not , it must display the default structure of the forum .
To perform this last , there must be new template tags which can be ignored if the plugin installation is wrong , so the plugin needs its proper template file …
We know that the goal of BBPress is to be light and fast , so if you code all the things above and use them on a plugin , BBPress will be slower , i think like PunBB …
So my tip is ; don’t use categories , try to remove no useful forums , merge some forums if they are similar , and you’ill have a good order without categories .
In reply to: profile_menu doesnt work on all pagesOk , i see that my messages are incomprehensible ( normal , i am not a native english speaker ) , i ill try again ( my english will suck a little ) .
I have this on my my-templates/footer.php :
<?php if ( $bb_current_user->ID ) : ?>
<li><h2 class="vcard">Profile</h2></li>
<li>
<?php profile_menu(); ?>
</li>
<?php endif; ?>
My goal is to display the avaible profil options for the connected user if no other user’s profil is viewed .
But it doesnt work until i dont go to another user’s profil and displays this error :
Warning: Invalid argument supplied for foreach() in /home/httpd/bouazza/bouazza.franceserv.com/sbouazza/forums/bb-includes/template-functions.php on line 59
And only one item is viewed , Profile , and it contains a bad link ( http://bouazza.franceserv.com/sbouazza/forums/profile/, without an user ID ) .
But if i am viewing an user’s profil , the menu is correctly displayed , and allthing is fine .
I Hope I can get more replys now .
Thanks !
PS : It will be great if we can speak here on this board in another language like French , German … espiecially for guys like me who ar’nt familiar with English .
Bouazza .
In reply to: profile_menu doesnt work on all pagesNo one ?
In reply to: profile_menu doesnt work on all pagesI edited correctly the message , sorry if it was incomprehensible .
I use that code on footer.php without modifying de template-functions.php file .
Normally , it shows only the profil menu if a user’s profil is viewed , but i wanted that the profil menu will be displayed using the current user’s settings if no profil is viewed .
In reply to: Determine topic’s statusThanks ardenfrost , i ill use get_topic_resolved .
In reply to: What do you think about my design ?Is the SAFE_MODE on ?
In reply to: What do you think about my design ?where’s blix located ? on bbpress or wordpress templates folder ?
In reply to: What do you think about my design ?You need to change themes tags to bbpress ones , but like i do’nt have anything to do today , i ill do that for you
In reply to: What do you think about my design ?Awesome
In reply to: How to get poster’s IDK , thanks !
In reply to: number of topic depend on database size?so that means i can have 10MB of topic in my forums, right?
Yes but its anything like 9,9 or low , because the table and collumn names take also place on your MySQL space , but like ranrar said , the size is’nt important .
In reply to: Getting user’s email addressOk i found the solution on another thread here : https://bbpress.org/forums/topic/168?replies=6#post-874 .
In reply to: AvatarsThanks Atsutane , $user->user_email is what i searched for !
In reply to: Getting user’s email addressOk , i ill look at the included php files .
In reply to: AvatarsNo , there’s a very simple way , simply use this url as the image url :
http://www.gravatar.com/avatar.php?gravatar_id=MD5
MD5 should be replaced by the md5 hash of the poster’s email address .
Look at the “How the URL is constructed” section on http://gravatar.com/implement.php if you need more options like the size , rating …
In reply to: AvatarsHello ,
try http://gravatar.com/ .
In reply to: How to customize bbpress titles ?Thanks for your help !
In reply to: Determine if its a member or an adminThanks very much for your help !