Loading...
 
Skip to main content

Development


List Users Blog Posts in MyTiki

What I´m trying to do is, instead of displaying only the blog for a user, I want his posts to be shown.
Sounds easy at first glance, but somehow I´m stuck.

I started with the template.
For "user blogs" there´s a loop through "$user_blogs"
So I traced this var and put a "$user_blog_posts" where i found "$user_blogs"

tiki-my_tiki:

Image
Copy to clipboard
$user_blog_posts = $bloglib->list_blog_posts(1,0,-1,'created_desc','','',$userwatch);


for getting the posts.
"list_blog_posts" in "bloglib" has been modified with a "where user=?" clause if $user was set.

Furthermore there where a lot of entries in tiki-user_preferences.php, like

Image
Copy to clipboard
$smarty->assign('mytiki_blogs', $tikilib->get_user_preference($userwatch, 'mytiki_blogs'), 'y');
I guess its about permissions, what I dont really need, but I just put:Image
Copy to clipboard
$smarty->assign('mytiki_blog_posts', $tikilib->get_user_preference($userwatch, 'mytiki_blog_posts'), 'y');


beneath it.

What is it I forgot ?
When I now try to loop through "user_blog_posts" in my_tiki.tpl with:

Image
Copy to clipboard
{section name=ix loop=$user_blog_posts}

and put the links together with:

Image
Copy to clipboard
a href="tiki-view_blog_post.php?blogId=1&postId={$user_blog_posts[ix].postId}">Open {$user_blog_posts[ix].title}


All I get is 2(??) blank links without postId.

Help ! ❓