Loading...
 
Skip to main content

Architecture / Installation


Modifying My Blogs module

posts: 47

Hi - I'm trying to modify the My Blogs module to list all blogs containing my user name in the description field, rather than just listing blogs I created. Any ideas on how this can be done?

---------

I detail one approach I hoped would work, but no luck:

(1) modify the list_user_blogs function in tikilib.php as follows:

$query = "select * from `tiki_blogs` where `user`=?";

$query = "select * from `tiki_blogs` where (`description` like ?)";

Unfortunately, this requires the ENTIRE description field to be ONLY my username. Not useful.

(2) I would think the following would solve the problem. The % signs serving as wildcards. But wildcards are not allowed in php (right?):

(`description` like %?%)

Is there another way to insert wildcards or regex expressions into tikilib.php?

posts: 2881 United Kingdom

Hi,

Yep you need to use the % parameter,

also grep the source to make sure that by modifing that function for your purpose you arent going to break it elsewhere.

Damian 😉


posts: 47
Thanks Damian, but the % sign actually breaks it. I get an error message that I've written the select statement wrong, and should go learn more about sql queries 😕
posts: 2881 United Kingdom

> sam_a:
> Thanks Damian, but the % sign actually breaks it. I get an error message that I've written the select statement wrong, and should go learn more about sql queries 😕

sorry maybe I should be a little more specific, look in an exisiting get function where it checks for the $find parameter, you'll need to merge that in your select

Damian


posts: 2881 United Kingdom

> sam_a:
> Thanks Damian, but the % sign actually breaks it. I get an error message that I've written the select statement wrong, and should go learn more about sql queries 😕

sorry maybe I should be a little more specific, look in an exisiting get function where it checks for the $find parameter, you'll need to merge that in your select

Damian