rm
unread,Nov 13, 2009, 11:29:11 AM11/13/09Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Pixie
If you want to try this, first make a backup of admin/modules/
dynamic.php. Then, edit dynamic.php around the following lines (the
line numbers may not be the same in your file as mine, so look for the
matching code):
original 118 is: $rs = safe_rows_start("*", "pixie_dynamic_posts",
"page_id = '$page_id' and public = 'yes' and posted < now() order by
posted desc limit $start,$posts_per_page");
change 118 to: $rs = safe_rows_start("*, title RLIKE '^\\\\[Top
Story]' AS sticky", "pixie_dynamic_posts", "page_id = '$page_id' and
public = 'yes' and posted < now() order by sticky desc, posted desc
limit $start,$posts_per_page");
original 132 is: $rs = safe_rows_start("*", "pixie_dynamic_posts",
"page_id = '$page_id' and public = 'yes' and posted < now() and tags
REGEXP '[[:<:]]". $x ."[[:>:]]' order by posted desc limit $start,
$posts_per_page");
change 132 to: $rs = safe_rows_start("*, title RLIKE '^\\\\[Top
Story]' AS sticky", "pixie_dynamic_posts", "page_id = '$page_id' and
public = 'yes' and posted < now() and tags REGEXP '[[:<:]]".
$x ."[[:>:]]' order by sticky desc, posted desc limit $start,
$posts_per_page");
original 138 is: $rs = safe_rows_start("*", "pixie_dynamic_posts",
"page_id = '$page_id' and public = 'yes' and posted < now() and tags
REGEXP '[[:<:]]". $x ."[[:>:]]' order by posted desc limit
$posts_per_page");
change 138 to: $rs = safe_rows_start("*, title RLIKE '^\\\\[Top
Story]' AS sticky", "pixie_dynamic_posts", "page_id = '$page_id' and
public = 'yes' and posted < now() and tags REGEXP '[[:<:]]".
$x ."[[:>:]]' order by sticky desc, posted desc limit
$posts_per_page");
original 152 is: $rs = safe_rows_start("*", "pixie_dynamic_posts",
"page_id = '$page_id' and public = 'yes' and posted < now() order by
posted desc limit $posts_per_page");
change 152 to: $rs = safe_rows_start("*, title RLIKE '^\\\\[Top
Story]' AS sticky", "pixie_dynamic_posts", "page_id = '$id' and public
= 'yes' and posted < now() order by sticky desc, posted desc limit
$posts_per_page");
Then, if you preface your blog posts with [Top Story] those posts will
always appear at the top of the list. Basically, what the queries are
doing is returning a value of 1 or 0 respectively to the alias
'sticky' if the regular expression finds [Top Story] at the start of
the title or not. Then, the query sorts all the results first by
sticky, and then by date.