display_dat, start page identifier and author
Posted: Fri Jan 19, 2007 9:57 pm
Hello,
i (again) could need some help.
I have 3 questions right now:
First:
I want to identify the index page of the blog. I currently use
but I'm quite sure that's not a clean way 
Is there a better way?
Second:
I want to put some code in front of the displayed entries. But I can only get it behind the entries with the 'display_dat' from the "frontend_display:html:per_entry"-hook.
I'm currently trying to manage some work around with a combination of "entries_header", "entry_display" and "frontend_display:html:per_entry":
"frontend_display:html:per_entry" should display every itemfor the second-to-last entry, the other two only for the first. The problem is, that I'm depended on the 'authorId', which I can get in "entry_display" but not in "entries_header". On the other hand isn't it possible to print any HTML with "entry_display".
Creating the HTML with "entry_display" and displaying it with "entries_header" isn't an option, cause "entries_header" is called first.
...
I hope somebody even undestands what I wanna say
(Creating a new Hook is out of question, because I want to create an independant plugin).
Third:
I wrote another Plugin, which allowes the administrator to publish a post under the name of another user (actually, it's their post after saving).
I'm using the "backend_entry_presave"-Hook to change the 'authorId' in the Entry-Data before saving.
This works fine with a new entry, because the 'authorId' is set with
(no actual code, just the same meaning).
But when an existing entry is beeing edited, 'authorId' is set without asking if it is already defined.
I currently just change the method code, but therefore lost all usability as a plugin.
Any idea (without editing serendipity code)?
Thanks again,
loli
i (again) could need some help.
I have 3 questions right now:
First:
I want to identify the index page of the blog. I currently use
Code: Select all
strpos($serendipity['GET']['subpage'], "?/index.php")
Is there a better way?
Second:
I want to put some code in front of the displayed entries. But I can only get it behind the entries with the 'display_dat' from the "frontend_display:html:per_entry"-hook.
I'm currently trying to manage some work around with a combination of "entries_header", "entry_display" and "frontend_display:html:per_entry":
"frontend_display:html:per_entry" should display every itemfor the second-to-last entry, the other two only for the first. The problem is, that I'm depended on the 'authorId', which I can get in "entry_display" but not in "entries_header". On the other hand isn't it possible to print any HTML with "entry_display".
Creating the HTML with "entry_display" and displaying it with "entries_header" isn't an option, cause "entries_header" is called first.
...
I hope somebody even undestands what I wanna say
(Creating a new Hook is out of question, because I want to create an independant plugin).
Third:
I wrote another Plugin, which allowes the administrator to publish a post under the name of another user (actually, it's their post after saving).
I'm using the "backend_entry_presave"-Hook to change the 'authorId' in the Entry-Data before saving.
This works fine with a new entry, because the 'authorId' is set with
Code: Select all
if(!isset($entry_data['authorId'])) $entry_data['authorId'] = $current_user['id'];
But when an existing entry is beeing edited, 'authorId' is set without asking if it is already defined.
I currently just change the method code, but therefore lost all usability as a plugin.
Any idea (without editing serendipity code)?
Thanks again,
loli