Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#136 2013-02-19 06:43:17
Re: stm_article_order: Arbitrary sort order for your articles
I concur – both errors on the nightly build too
Offline
#137 2013-02-19 10:23:04
Re: stm_article_order: Arbitrary sort order for your articles
hi and thanks for keeping this alive!
i also do have a problem..
i installed the 0.3 on a txp 4.5.4 and i get error messages.
in the extensions tab, there alerts:
internal error “Undefined variable:db_sections” & internal error “Invalid argument supplied forech()”
in the article order tab it alerts:
internal error “Unknown column ‘spr_exclude’ in ‘where clause’”
sounds like the tables are missing, eh? where do these get created..?
Offline
#138 2013-02-19 13:35:48
Re: stm_article_order: Arbitrary sort order for your articles
Hi all
Apologies for the errors. My local copy was working but on checking through the code, I’ve noticed a few issues with it! (Not quite sure how it was working on my install at all!)
Anyway, I’m working on it and should have a revised version up by the end of today.
Thanks for your patience and for the positive reception – it’s good to know I’m not the only one benefiting from this old plugin and that there is demand to keep it going longer.
Keep an eye out for more news later and a revised version that should (hopefully!) work as described.
Offline
#139 2013-02-19 16:02:53
Re: stm_article_order: Arbitrary sort order for your articles
OK, hopefully problems now sorted.
I’ve tried this with a clean install of txp 4.5.4 and it works for me. Please let me know if you have any problems with it.
I’ve kept the version number the same as it is only a bug fix and the earlier version didn’t work!
Installing the plugin creates the extra column in the txp_section table of the database. Deleting the plugin removes the extra column, returning the db table back to the state it was in before the plugin was installed.
I’ve purposely excluded the default section from the Article Order Sections tab since it can’t hold any articles.
Download link: stm_article_order 0.3
Thanks for your patience while I sorted out the issues. I hope this is now of use to you all.
Last edited by springworks (2013-02-19 16:05:49)
Offline
#140 2013-02-19 16:08:22
Re: stm_article_order: Arbitrary sort order for your articles
It’s working … :))
Thanks Steve
Last edited by RedFox (2013-02-19 16:09:02)
Offline
#141 2013-02-19 16:51:59
Re: stm_article_order: Arbitrary sort order for your articles
Good stuff!
Enjoy :-)
Offline
#142 2013-02-19 22:20:57
Re: stm_article_order: Arbitrary sort order for your articles
Yup – a quick look and it seems to be working on the nightly too :)
Thanks Steve
Offline
#143 2013-02-20 01:06:17
- GugUser
- Member

- From: Quito (Ecuador)
- Registered: 2007-12-16
- Posts: 1,477
Re: stm_article_order: Arbitrary sort order for your articles
Now it works fine. Thank you.
Offline
#144 2013-02-22 16:20:11
Re: stm_article_order: Arbitrary sort order for your articles
high.
works fine on my end as well.
i often do use multiple article images, and if so, the list wont come up with them, instead its skipping them all.
here is my fix: Please ignore, even better fix below.
if (is_numeric($article['Image'])) {
$tmp .= '<span class="article_title status_'.$article['Status'].'"><a href="index.php?event=image&step=image_edit&id='.$article['Image'].'" title="Edit image" class="image-edit"><img class="article-img" src="'.hu.$img_dir.'/'.$article['Image'].'t.jpg" /></a>'.$article['Title']." <em class='article_id'><a title='Edit article' href='index.php?event=article&step=edit&ID=".$article['ID']."'>(".$article['ID'].")</a></em></span>";
} else if (is_string($article['Image'])) {
$img = explode(",", $article['Image']);
$tmp .= '<span class="article_title status_'.$article['Status'].'"><a href="index.php?event=image&step=image_edit&id=' . $img[0] . '" title="Edit image" class="image-edit"><img class="article-img" src="'.hu.$img_dir.'/' . $img[0] . 't.jpg" /></a>'.$article['Title']." <em class='article_id'><a title='Edit article' href='index.php?event=article&step=edit&ID=".$article['ID']."'>(".$article['ID'].")</a></em></span>";
} else {
$tmp .= '<span class="article_title status_'.$article['Status'].'">'.$article['Title']." <em class='article_id'><a title='Edit article' href='index.php?event=article&step=edit&ID=".$article['ID']."'>(".$article['ID'].")</a></em></span>";
}
Last edited by uli (2013-05-10 22:02:15)
Offline
#145 2013-04-19 15:21:54
Re: stm_article_order: Arbitrary sort order for your articles
Hi guys,
Great work on resurrecting this plugin, clients love it :)
I’m a bit confused about versions here – are there two development forks going on? (0.24 and 0.3)
I’m trying to get stm_link_to_prev and next working with little success, tried both forks and updated to TXP 4.5.4 too.
Cheers, Nick
“Eat food. Not too much. Mostly plants.” – Michael Pollan
Offline
#146 2013-04-19 15:44:47
Re: stm_article_order: Arbitrary sort order for your articles
FCS_Websites wrote:
Hi guys,
Great work on resurrecting this plugin, clients love it :)
I’m a bit confused about versions here – are there two development forks going on? (0.24 and 0.3)
I’m trying to get stm_link_to_prev and next working with little success, tried both forks and updated to TXP 4.5.4 too.
Cheers, Nick
Hi Nick
I’m not sure there are two branches being developed!
I added the section choice bits to the latest version of the plugin that Uli had released (0.2.4) and I upped the version number to 0.3. So 0.3 is 0.2.4 with the ability to choose which sections are included in the drag and drop interface to order articles.
If anyone else wants to continue development from where it stands now, that’s fine by me.
I’m afraid I don’t use stm_link_to_prev or stm_link_to_next and haven’t looked into how they work so can’t help you out with that at the moment.
Offline
#147 2013-04-23 17:44:53
- uli
- Moderator

- From: Cologne
- Registered: 2006-08-15
- Posts: 4,316
Re: stm_article_order: Arbitrary sort order for your articles
Hi everyone,
I’ve withdrawn a little from this plugin and topic, for several reasons. Now I’ve installed the 0.3 version for the first time and want to clear some of my “backlogs”.
Steve, thanks for pushing this plugin quite a bit further. I’ve always treated sections to hide via CSS but knew it wasn’t an adequate way even for site admins. Good to have a clean special panel for this now. Thanks!
Like you, I don’t see two different branches and would add my changes to the latest, most recent version of the plugin.
Nick, the prev/next tags had been announced by trenc but haven’t been tested enough, I believe. Hope they’ll be published soon, quite useful to have.
Jens has made one several improvements to the image handling of the code. Thanks, Jens!
Final code see below.
{Edited link.}
Last edited by uli (2013-05-10 22:07:38)
In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links
Offline
#148 2013-05-08 18:10:06
Re: stm_article_order: Arbitrary sort order for your articles
yo
was a bit unhappy with the above solution since it expects jpgs. but what about gif & png?
so i digged into redbot’s fine plugins and stole some parts out of it to get the image and its extension. thanks redbot ;)
so please feel free to replace: Please ignore, even better fix below.
if(is_numeric($article['Image'])){
$tmp .= '<span class="article_title status_'.$article['Status'].'"><a href="index.php?event=image&step=image_edit&id='.$article['Image'].'" title="Edit image" class="image-edit"><img class="article-img" src="'.hu.$img_dir.'/'.$article['Image'].'t.jpg" /></a>'.$article['Title']." <em class='article_id'><a title='Edit article' href='index.php?event=article&step=edit&ID=".$article['ID']."'>(".$article['ID'].")</a></em></span>";
}else{
$tmp .= '<span class="article_title status_'.$article['Status'].'">'.$article['Title']." <em class='article_id'><a title='Edit article' href='index.php?event=article&step=edit&ID=".$article['ID']."'>(".$article['ID'].")</a></em></span>";
}
with:
if(is_numeric($article['Image'])){
$tmp .= '<span class="article_title status_'.$article['Status'].'"><a href="index.php?event=image&step=image_edit&id='.$article['Image'].'" title="Edit image" class="image-edit"><img class="article-img" src="'.hu.$img_dir.'/'.$article['Image'].'t.jpg" /></a>'.$article['Title']." <em class='article_id'><a title='Edit article' href='index.php?event=article&step=edit&ID=".$article['ID']."'>(".$article['ID'].")</a></em></span>";
} else if (is_string($article['Image'])) {
$img = explode(",", $article['Image']);
$rs = safe_rows('ext,id', 'txp_image', 'id in ('.$img[0].')');
extract($rs);
$tmp .= '<span class="article_title status_'.$article['Status'].'"><a href="index.php?event=image&step=image_edit&id=' . $img[0] . '" title="Edit image" class="image-edit"><img class="article-img" src="'.hu.$img_dir.'/' . $rs[0]['id'] . 't' . $rs[0]['ext'] . '" /></a>'.$article['Title']." <em class='article_id'><a title='Edit article' href='index.php?event=article&step=edit&ID=".$article['ID']."'>(".$article['ID'].")</a></em></span>";
} else {
$tmp .= '<span class="article_title status_'.$article['Status'].'">'.$article['Title']." <em class='article_id'><a title='Edit article' href='index.php?event=article&step=edit&ID=".$article['ID']."'>(".$article['ID'].")</a></em></span>";
}
(i didnt touch the first arguement thought, just my part..)
Last edited by uli (2013-05-10 22:01:37)
Offline
#149 2013-05-08 20:34:16
- uli
- Moderator

- From: Cologne
- Registered: 2006-08-15
- Posts: 4,316
Re: stm_article_order: Arbitrary sort order for your articles
Thanks, Jens, another milestone that’s been needed!
Some more progress: I tried a portion of your code for the is_numeric part of the switch and it worked :)
So the replacing goes: Search for Please ignore, even better fix below.
if(is_numeric($article['Image'])){
$tmp .= '<span class="article_title status_'.$article['Status'].'"><a href="index.php?event=image&step=image_edit&id='.$article['Image'].'" title="Edit image" class="image-edit"><img class="article-img" src="'.hu.$img_dir.'/'.$article['Image'].'t.jpg" /></a>'.$article['Title']." <em class='article_id'><a title='Edit article' href='index.php?event=article&step=edit&ID=".$article['ID']."'>(".$article['ID'].")</a></em></span>";
}else{
$tmp .= '<span class="article_title status_'.$article['Status'].'">'.$article['Title']." <em class='article_id'><a title='Edit article' href='index.php?event=article&step=edit&ID=".$article['ID']."'>(".$article['ID'].")</a></em></span>";
}
Replace with:
if(is_numeric($article['Image'])){
$img = explode(",", $article['Image']);
$rs = safe_rows('ext,id', 'txp_image', 'id in ('.$img[0].')');
extract($rs);
$tmp .= '<span class="article_title status_'.$article['Status'].'"><a href="index.php?event=image&step=image_edit&id=' . $img[0] . '" title="Edit image" class="image-edit"><img class="article-img" src="'.hu.$img_dir.'/' . $rs[0]['id'] . 't' . $rs[0]['ext'] . '" /></a>'.$article['Title']." <em class='article_id'><a title='Edit article' href='index.php?event=article&step=edit&ID=".$article['ID']."'>(".$article['ID'].")</a></em></span>";
} else if (is_string($article['Image'])) {
$img = explode(",", $article['Image']);
$rs = safe_rows('ext,id', 'txp_image', 'id in ('.$img[0].')');
extract($rs);
$tmp .= '<span class="article_title status_'.$article['Status'].'"><a href="index.php?event=image&step=image_edit&id=' . $img[0] . '" title="Edit image" class="image-edit"><img class="article-img" src="'.hu.$img_dir.'/' . $rs[0]['id'] . 't' . $rs[0]['ext'] . '" /></a>'.$article['Title']." <em class='article_id'><a title='Edit article' href='index.php?event=article&step=edit&ID=".$article['ID']."'>(".$article['ID'].")</a></em></span>";
} else {
$tmp .= '<span class="article_title status_'.$article['Status'].'">'.$article['Title']." <em class='article_id'><a title='Edit article' href='index.php?event=article&step=edit&ID=".$article['ID']."'>(".$article['ID'].")</a></em></span>";
}
Thanks again, Jens.
Last edited by uli (2013-05-10 22:01:12)
In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links
Offline
#150 2013-05-10 20:02:04
Re: stm_article_order: Arbitrary sort order for your articles
moin
found a bug in the above solution: if article image === empty { do stuff like its a string }. dont x me why. that causes the mysql query to suck, cause $img[0] would be emtpy then. may i introduce the fix? yes, please:
search:
if(is_numeric($article['Image'])){
$tmp .= '<span class="article_title status_'.$article['Status'].'"><a href="index.php?event=image&step=image_edit&id='.$article['Image'].'" title="Edit image" class="image-edit"><img class="article-img" src="'.hu.$img_dir.'/'.$article['Image'].'t.jpg" /></a>'.$article['Title']." <em class='article_id'><a title='Edit article' href='index.php?event=article&step=edit&ID=".$article['ID']."'>(".$article['ID'].")</a></em></span>";
}else{
$tmp .= '<span class="article_title status_'.$article['Status'].'">'.$article['Title']." <em class='article_id'><a title='Edit article' href='index.php?event=article&step=edit&ID=".$article['ID']."'>(".$article['ID'].")</a></em></span>";
}
replace:
if(is_numeric($article['Image'])){
$rs = safe_rows('ext,id', 'txp_image', 'id in ('.$article['Image'].')');
extract($rs);
$tmp .= '<span class="article_title status_'.$article['Status'].'"><a href="index.php?event=image&step=image_edit&id=' . $article['Image'] . '" title="Edit image" class="image-edit"><img class="article-img" src="'.hu.$img_dir.'/' . $rs[0]['id'] . 't' . $rs[0]['ext'] . '" /></a>'.$article['Title']." <em class='article_id'><a title='Edit article' href='index.php?event=article&step=edit&ID=".$article['ID']."'>(".$article['ID'].")</a></em></span>";
} else if (is_string($article['Image'])) {
$img = explode(",", $article['Image']);
if ($img[0]) {
$rs = safe_rows('ext,id', 'txp_image', 'id in ('.$img[0].')');
extract($rs);
$tmp .= '<span class="article_title status_'.$article['Status'].'"><a href="index.php?event=image&step=image_edit&id=' . $img[0] . '" title="Edit image" class="image-edit"><img class="article-img" src="'.hu.$img_dir.'/' . $rs[0]['id'] . 't' . $rs[0]['ext'] . '" /></a>'.$article['Title']." <em class='article_id'><a title='Edit article' href='index.php?event=article&step=edit&ID=".$article['ID']."'>(".$article['ID'].")</a></em></span>";
} else {
$tmp .= '<span class="article_title status_'.$article['Status'].'">'.$article['Title']." <em class='article_id'><a title='Edit article' href='index.php?event=article&step=edit&ID=".$article['ID']."'>(".$article['ID'].")</a></em></span>";
}
}
Last edited by jens31 (2013-05-10 20:07:47)
Offline