here is the hacked code.. this will show the favorites on profile page in the admin section of wordpress. I haven’t tested it but this is the basic idea.
please note that the wordpress must be integrated both ways before you can do this. visit this for more
add_action('show_user_profile',
'my_plugin_show_favorites');
function my_plugin_show_favorites() {
$topics = get_user_favorites( $user->ID, true );
?>
<br clear="all" />
<table width="99%" border="0"
cellspacing="2" cellpadding="3">
<tr>
<th><?php _e('Topic'); ?></th>
<th><?php _e('Posts'); ?></th>
<th><?php _e('Freshness'); ?></th>
<th><?php _e('Remove'); ?></th>
</tr>
<?php foreach ( $topics as $topic ) : ?>
<tr<?php topic_class(); ?>>
<td><a href="<?php topic_link(); ?>">
<?php topic_title(); ?></a></td>
<td class="num"><?php
topic_posts();
?></td>
<td class="num"><small><?php
topic_time();
?></small></td>
<td class="num">[<?php
user_favorites_link(
'',
array('mid'=>'x'),
$user_id
);
?>]</td>
</tr>
<?php endforeach; ?>
</table>
<div class="nav">
<?php favorites_pages(); ?>
</div>
<?php
}
So if I understand right, I should use this code as a WP plugin?
I tried that and I get an error:
Warning: Invalid argument supplied for foreach() in /home/tasty.sk/tasty.sk/www/wp-content/plugins/bbpress-favorites.php on line 30
It is shown in profile main page…it is possible to create another separate page for that?
yup use it in wordpress.. if i understand you right.. you want to show it on the wordpress profile page right? the one which is
<you website.com>/wp-admin/profile.php
try changing the code to
<?php if ($topics): foreach ( $topics as $topic ) : ?>
..
..
..
..
..
<?php endforeach; endif; ?>
I change it, know there is no error, but no favorite forum shows up.
The deal is that my favorites dissaper, if I point my browser to http://www.tasty.sk/forum/profile/username/favorites, it redirects me to http://www.tasty.sk/user/username//favorites
It worked before, but probably I changed something so I thought maybe I create another favorites page
vlp..
you said you want to show the favorites in the wordpress profile.
http://www.tasty.sk/forum/profile/username/favorites
this is the link to the bbpress profile page.
i am confused now can you try to explain again what are you trying to do?
I’m sorry, I confused little myself too:)
Ok here is the deal
Because the bbpress profile page doesn’t work, I want to show user favorites on wordpress profile page (the best on separate page – tab), like Extended Profile from Userextra plugin.
I still didn’t solve this, so If anybody has an good point I will preciated;)