Loading...
 
Architecture / Installation

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 wink


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 confused
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 confused

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 confused

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


Upcoming Events

1)  18 Apr 2024 14:00 GMT-0000
Tiki Roundtable Meeting
2)  16 May 2024 14:00 GMT-0000
Tiki Roundtable Meeting
3)  20 Jun 2024 14:00 GMT-0000
Tiki Roundtable Meeting
4)  18 Jul 2024 14:00 GMT-0000
Tiki Roundtable Meeting
5)  15 Aug 2024 14:00 GMT-0000
Tiki Roundtable Meeting
6)  19 Sep 2024 14:00 GMT-0000
Tiki Roundtable Meeting
7) 
Tiki birthday
8)  17 Oct 2024 14:00 GMT-0000
Tiki Roundtable Meeting
9)  21 Nov 2024 14:00 GMT-0000
Tiki Roundtable Meeting
10)  19 Dec 2024 14:00 GMT-0000
Tiki Roundtable Meeting