1 gousty Jun 15, 2004 23:54
3 gousty Jun 16, 2004 08:12
can i get it to display by order of time of post?
4 waltercruz Jun 16, 2004 21:41
Well, the links inside the categories os likroll get alphabeticaly listes..
But the categories are listed in the order of creation..(is this a bug ?)
[]?s
- Walter
5 gousty Jun 17, 2004 05:12
i should prolly just use "multiblogs.php" and incorporate that idea into my skin.
thanx for everything guys
6 graham Jun 27, 2004 18:51
Is there any update on being able to display the linkblog by category title, rather than category Id?
7 mollyc Jul 29, 2004 14:03
Is it possible to re-order the linkblog by date instead of alphabetically?
How can I make that happen?
Thanks--
Molly
8 dkitty Aug 06, 2004 20:44
I'm interested in listing the linkblog categories alphabetically as well. Has anyone come up with a solution that works? Any ideas? I'm not really sure where to start.
9 dkitty Aug 08, 2004 01:07
The only idea I've had so far is to play around with the sort function. And I'm getting nowhere.
10 isaac Aug 09, 2004 07:39
Ok, here's what has to be done, and why this is tricky.
Might wanna open up blogs/skins/_linkblog.php to follow along.
We open up the linkblog like this on line 46:
$LinkblogList = & new ItemList( $linkblog, array(), '', '', '', $linkblog_cat, $linkblog_catsel, '', 'ASC', 'category title', '', '', '', '', '', '', '', '', $linkblog_limit, 'posts', $timestamp_min, $timestamp_max );
Here's that line explained:
$LinkblogList = & new ItemList(
$linkblog, // the ID of the blog that we want, set earlier in the file
array(), // the post statuses to grab. array() is the default.
'', // specific post number to display - none selected
'', // YYYYMMDD to display - none selected
'', // week number to display - none selected
$linkblog_cat, // list of cats to display - recursive
$linkblog_catsel, // array of cats to display - non-recursive
'', //list of authors to restrict to
'ASC', // ASCending or DESCending
'category title', // fields to sort by, in the order to use them
// some other stuff:
'', '', '', '', '', '', '', '', $linkblog_limit, 'posts', $timestamp_min, $timestamp_max );
Then, it creates a SQL command kinda like this:
SELECT DISTINCT ID, post_author, post_issue_date, post_mod_date,
post_status, post_locale, post_content, post_title,
post_urltitle, post_url, post_category,
post_autobr, post_flags, post_wordcount, post_comments,
post_renderers, post_karma
WHERE blog_id = $linkblog
ORDER BY post_category, post_title
Note that it adds post_ to the strings that are passed in.
Here's how you could do it, but it's a big ugly core-file-modifying hack. A more elegant solution would be preferrable.
0. Back up b2evocore/_class_itemlist.php, and the _linkblog.php and _blogroll.php files that you modify. This is never a bad idea.
1. Open up b2evocore/_class_itemlist.php
2. Around line 355, find this bit:
else
{
$orderby_array = explode(' ',$orderby);
$orderby = $orderby_array[0]. ' '. $order;
if (count($orderby_array)>1)
{
for($i = 1; $i < (count($orderby_array)); $i++)
{
$orderby .= ', post_' . $orderby_array[$i]. ' '. $order;
}
}
}
Change it to this:
else
{
$add_postpref = ( strpos($orderby, '.') === false );
$orderby_array = explode(' ',$orderby);
$orderby = $orderby_array[0]. ' '. $order;
if (count($orderby_array)>1)
{
for($i = 1; $i < (count($orderby_array)); $i++)
{
$orderby .= ', ' . ($add_postpref ? 'post_' : '') . $orderby_array[$i]. ' '. $order;
}
}
}
Note the added line ($add_postpref) and the change to the "$orderby .= ..." line.
3. Around line 496 (it WAS 495, but we added a line in step 2), find this bit:
$this->request .= $where. " ORDER BY post_$orderby $limits";
Replace it with this:
$this->request .= $where. " ORDER BY " . ($add_postpref ? 'post_' : '') . "$orderby $limits";
4. Save and close _class_itemlist.php
5. Open up skins/_linkblog.php, or skins/skin_name/_linkblog.php, or skins/_blogroll.php or skins/skin_name/_blogroll.php
6. Find this line:
$LinkblogList = & new ItemList( $linkblog, array(), '', '', '', $linkblog_cat, $linkblog_catsel, '', 'ASC', 'category title', '', '', '', '', '', '', '', '', $linkblog_limit, 'posts', $timestamp_min, $timestamp_max );
Replace it with this:
$LinkblogList = & new ItemList( $linkblog, array(), '', '', '', $linkblog_cat, $linkblog_catsel, '', 'ASC', $tablecategories.'.cat_name post_title', '', '', '', '', '', '', '', '', $linkblog_limit, 'posts', $timestamp_min, $timestamp_max );
I found that this can produce odd results if your linkblog posts are in multiple categories. I recommend saving the affected post in just a single category if that happens - this hack is ugly enough as it is.
[url=http://b2evolution.net/dev/todo/2004/08/09/category_order_in_linkblog]I've added this issue to the ToDo list.[/url]
11 dkitty Aug 09, 2004 16:30
8|
Thank you for the thorough explination along with the modified code Isaac. I'd only been plaing with the bit you mentioned from /skins/_linkblog.php so far. It's too bad this sort of thing requires core file hacking. One of the things I like so much about b2evo is that the skins and core files are so well seperated.
I'm willing to give this a try. Thank you very much for posting.
12 waltercruz Aug 09, 2004 16:36
I was thinking about it..
Could be a useful feature to b2evo has a way to identid the linkblog blogs and doesn?t allow more than a category by post..
[]?s
- Walter
13 avoidinglife Feb 02, 2005 12:59
I like the linkblog feature, but I really don't see the use if it's in alphabetical order only. How will people know when there's a new story?
Anyway I tried the core hack that was listed but it just game me an error and the site wouldn't load. I don't see this change listed any more on the To Do list either. What gives?
Is this feature going to be fixed in the future?
14 edb Feb 02, 2005 14:32
Generally speaking a linkblog isn't really a place for story telling. You of course can have content with your linkblog posts, but it'll show up in the sidebar, which can make for a very long sidebar over time. Anyway to answer your question: cross-post in your blog-blog and linkblog.
15 avoidinglife Feb 02, 2005 15:31
I guess the thing I'd like to see is a sidebar that lists the 4 or 5 most recent posts from another blog, such as the linkblog. I guess this could be done using RSS or something else, but the linkblog sidebar code is already there and just needs some kind of tweek to get it to do this.
16 marston Feb 16, 2005 01:19
mollyc wrote:
Is it possible to re-order the linkblog by date instead of alphabetically?
How can I make that happen?
Thanks--
Molly
yeah...
17 marston Feb 16, 2005 01:32
Err... wtf? Thats giving me a huge error...
MySQL error!
Unknown column 'issue_date' in 'order clause'(Errno=1054)
Your query:
SELECT DISTINCT ID, post_author, post_issue_date, post_mod_date, post_status, post_locale, post_content, post_title, post_urltitle, post_url, post_category, post_autobr, post_flags, post_wordcount, post_comments, post_renderers, post_karma FROM (evo_posts INNER JOIN evo_postcats ON ID = postcat_post_ID) INNER JOIN evo_categories ON postcat_cat_ID = cat_ID WHERE cat_blog_ID = 2 AND ( ( post_status = 'private' AND post_author = 1 ) OR post_status IN ('published','protected') ) AND post_issue_date <= '2005-02-15 18:31:20' ORDER BY issue_date DESC LIMIT 20
18 edb Feb 16, 2005 01:41
Try post_issue_date
19 marston Feb 16, 2005 01:52
Whaa?
20 edb Feb 16, 2005 02:10
Look at the error.
unknown column 'issue_date'...
There is no such column, so it won't work. The very last bit of the error message tells you it is trying to ORDER BY this non-existant column.
...ORDER BY issue_date DESC...
Now look at your hack and change issue_date to post_issue_date.
21 marston Feb 16, 2005 02:12
I dont see where that code is though...
22 marston Feb 16, 2005 02:20
K, well. I dont get any errors, but I don't get any results either. This hack doesnt work, I guess...
23 frank Mar 09, 2005 11:43
I have to agree: it's a major nuisance that the linkblog can simply be switched between date-order and alphabetical-order. How difficult would it be to change this for the next update?
24 esanchez Jan 27, 2006 04:54
$LinkblogList = & new ItemList(
$linkblog, // the ID of the blog that we want, set earlier in the file
array(), // the post statuses to grab. array() is the default.
'', // specific post number to display - none selected
'', // YYYYMMDD to display - none selected
'', // week number to display - none selected
$linkblog_cat, // list of cats to display - recursive
$linkblog_catsel, // array of cats to display - non-recursive
'', //list of authors to restrict to
'ASC', // ASCending or DESCending
'category title', // fields to sort by, in the order to use them
// some other stuff:
'', '', '', '', '', '', '', '', $linkblog_limit, 'posts', $timestamp_min, $timestamp_max );
What are other choices for "Sorting By"
Can i do "Post Date", or "Post Name", etc?
25 nealo Mar 27, 2006 21:08
I couldn't figure out the post_issue_date problem either, but I know about ZERO with regard to MySQL.
My solution was simply to change ASC to DSC (thanks for showing that I could do that isaac in your SQL query explanation). This works as I title my Linkblog posts with a date - "Week ending 2006:04.01"
My new problem is that I can't seem to figure out how to eliminate the space after the post title. I don't see any br codes in there in the linkblog.php (the main one) ... Any idea how to do this? (www.autodogmatic.com)
Neal
26 nealo Mar 30, 2006 19:46
Okay, another weird thing: the spacing between the first heading (it's bolded) and the first list is greater than the second heading and the second list. There's no break tags or hard returns to warrant this space. Anybody got any ideas? This seems like a firefox issue as in IE it's fine.
Im pretty sure it does it alphabetically