Page 1 of 2
Show Entries Plugin
Posted: Mon May 15, 2006 1:05 am
by azel
Okay....I need help. I'm trying to get this plugin to work, but apparently my settings are wrong.
I set up a new category to post entries to this category only in the sidebar. What exactly am I supposed to put for the category ID - the number itself? The number plus the title of the category? I've tried this both ways, but I can't get anything to post under my sidebar, which is entitled "Mini Blog". It posts to the main content with nothing showing under Mini Blog.
Can someone help me out? I feel stupid that I can't get stuff to work on Serendipity these days.
Thanks in advance.
Re: Show Entries Plugin
Posted: Mon May 15, 2006 9:32 am
by garvinhicking
Hi!
You need to enter the categoryid there; you can get that ID when you hover about the category name in the "Manage Categories" section!
HTH,
Garvin
Posted: Mon May 15, 2006 3:57 pm
by azel
>_< But is the category ID just the number itself? Can you give me an example?
Here is a screenshot of my settings:
http://aetheric-shade.org/images/settings.jpg
There I've tried posting under Mini Blog. It doesn't work. The entry shows up on the main page and not on my sidebar.
http://aetheric-shade.org
Thanks!
Posted: Mon May 15, 2006 4:23 pm
by garvinhicking
Hi!
Yes, the number itself is right.
It seems that either the template file is not parsed, or that the fetchEntries function is failing. Maybe you could just try to edit the plugin_showentries.tpl file from the plugin and add some HTML at the top of the file, just to see if that is then shown in your sidebar.
If it is not shown, the plugin cannot parse your template file because it might not have read permission.
If that HTML is shown it just means that the fetchEntries() function itself is failing; in this case could you please open your serendipity_plugin_showentries.php file and search this:
Code: Select all
$entries = serendipity_fetchEntries(null, true, $limit, false, false, 'timestamp DESC', '', false, true);
After that line, add this:
And then we'll see furhter.
Regards,
Garvin
Posted: Tue May 16, 2006 2:45 am
by azel
Thanks Garvin!
Here goes:
I tried adding HTML into my showentries.tpl file, but there was no HTML output under my MiniBlog sidebar.
I CHMODed my permissions to 766 on the plugin folder itself and the showentries TPL/PHP also.
Oops! I'm running Serendipity 1.0-beta2 and using version 1.4 of the Show Entries Plugin.
I guess it just doesn't like me. ^^;;
Posted: Tue May 16, 2006 11:13 am
by garvinhicking
Hi!
Did you add that "print_r" code like I suggested? Which output does it produce?
Maybe you could add a
before the print_r and see if that is outputted?
Regards,
Garvin
Posted: Tue May 16, 2006 3:15 pm
by azel
The print_r code produces this under the sidebar:
Fetch Result:
1
Thanks!
Posted: Tue May 16, 2006 3:32 pm
by garvinhicking
Hi!
Oh, that's quite un-good.
Please edit your include/functions_entries.inc.php function and locate the serendipity_fetchEntries() function.
There you see this code (or something similar):
Code: Select all
$ret = serendipity_db_query($query, $fetch_single, 'assoc');
alter that to:
Code: Select all
$ret = serendipity_db_query($query, $fetch_single, 'assoc');
echo "Q: $query<br />\n";
This should show you the SQL code used to fetch the entry listing in the sidebar (also for the main entries, but discard that output). With that SQL we should find why the query is failing (you might want to execute the SQL code in something like phpMyAdmin and see if it yields an error)
Best regards,
Garvin
Posted: Wed May 17, 2006 3:49 am
by azel
Well hrm....added that code to my functions_entries_inc.php, but without result when I post a new entry to the specified category.
As to querying the code on phpMyAdmin, here is the result:
MySQL said:
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '$ret = serendipity_db_query($query, $fetch_single, 'assoc')' at line 1
Maybe my server doesn't like this plugin? I'm using Dreamhost, which is an excellent, excellent host. Never had any problems out of them.
This is frustrating.. Thanks for being patient and trying to help me, Garvin!
Posted: Wed May 17, 2006 1:01 pm
by garvinhicking
Hi!
No, not the code I pasted should be tried in phpMyAdmin; you should see that "Q: SELECT ..." output on the Frontend of your blog! Not when posting an entry, but when viewing your entries on the frontpage! That must show up if you saved my code in the page; else no entries would show up at all on your blog!
What's your URL? It should not have to do anything with your server...
Best regards,
Garvin
Posted: Wed May 17, 2006 2:49 pm
by azel
Posted: Wed May 17, 2006 2:50 pm
by garvinhicking
Hi!
Do you still have that "echo "Q: $sql" part in your code? Can you paste your current include/functions_entries.inc.php file on
http://nopaste.php-q.net?
Regards,
Garvin
Posted: Wed May 17, 2006 2:56 pm
by azel
Whoops, it looks like when I changed that line, it did not save. I added the line again, and now this shows up on the sidebar:
Q: SELECT e.id, e.title, e.timestamp, e.comments, e.exflag, e.authorid, e.trackbacks, e.isdraft, e.allow_comments, e.last_modified, a.realname AS author, a.email , e.body, e.extended FROM serendipity_entries AS e LEFT JOIN serendipity_authors a ON e.authorid = a.authorid LEFT JOIN serendipity_entrycat ec ON e.id = ec.entryid LEFT JOIN serendipity_category c ON ec.categoryid = c.categoryid LEFT JOIN serendipity_authorgroups AS acl_a ON acl_a.authorid = 1 LEFT JOIN serendipity_access AS acl_acc ON ( acl_acc.artifact_mode = 'read' AND acl_acc.artifact_type = 'category' AND acl_acc.artifact_id = c.categoryid ) WHERE isdraft = 'false' AND ( c.category_left BETWEEN 5 AND 6) AND e.timestamp <= 1147870490 AND ( c.categoryid IS NULL OR ( acl_acc.groupid = acl_a.groupid OR acl_acc.groupid = 0) OR ( acl_acc.artifact_id IS NULL ) ) GROUP BY e.id ORDER BY timestamp DESC LIMIT 15, 15
Fetch Result:
1
Will still upload the file though, just in case.
Posted: Wed May 17, 2006 3:23 pm
by garvinhicking
Hi!
I think I found the problem, that happens because of the "LIMIT 15, 15" statement.
To fix this, please try to edit your serendipity_plugin_showentries.php file. Please replace it with this content:
http://nopaste.php-q.net/212711
HTH,
Garvin
Posted: Wed May 17, 2006 4:00 pm
by azel
An error shows up on the sidebar now:
Parse error: syntax error, unexpected T_VARIABLE in /home/.alina/azel/aetheric-shade.org/plugins/serendipity_plugin_showentries/serendipity_plugin_showentries.php on line 90