Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

  1. Index
  2. » Archives
  3. » [archived] sdr_guestbook

#145 2008-03-24 14:08:10

roelof
Member
Registered: 2005-03-27
Posts: 647

Re: [archived] sdr_guestbook

Hello Els,

That was the problem, i had typed form=guestbook_comments_form’ instead of form=default.
Learn process is a hard way for textpatttern.

But i have still the problem that the rest of my site works with messy url’s and this plugin seems to work with clean url’s

Roelof

Last edited by roelof (2008-03-24 14:20:27)

Offline

#146 2008-03-24 15:21:40

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: [archived] sdr_guestbook

Hmm… I assume that is in the plugin code for the pagination. I have a plugin version myself but I don’t know if the version you are using is the same. Can you post the part of the plugin code that is between

// previous link

and

// end comments paging

(I’m not promising anything, I’m not much of a coder…)

Offline

#147 2008-03-24 15:39:49

roelof
Member
Registered: 2005-03-27
Posts: 647

Re: [archived] sdr_guestbook

hello Els,

I use the 4.0 sed version.
I think you mean this part :

$com_count = safe_count(‘txp_discuss’,“parentid=$ID and visible=1”); $pagenums = ceil ($com_count/$pagelimit); // if no value for page, page = 1 if ($page==”“){ $page=‘1’; } // create a start value $totalrows=$com_count; $start = ($page-1) * $pagelimit; // Showing Results 1 to 1 (or if you’re page limit were 5) 1 to 5, etc. $starting_no = $start + 1;

if ($totalrows – $start < $pagelimit) { $end_count = $totalrows; } elseif ($totalrows – $start >= $pagelimit) { $end_count = $start + $pagelimit; }

// create dynamic next, previous, and page links

Roelof

Offline

#148 2008-03-24 17:23:19

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: [archived] sdr_guestbook

It’s not that part (we need the code that generates the URLs), but never mind because I’ve got the same version. I will have a look at it and let you know if I can figure out how to change it.

Edit: you can post code here by using bc. (or bc.. if there are blank lines in it). Like this:

bc. <here your code>
<here some more code>

or

bc.. <here some code>

<here some more code>

(Using bc.. you need to start the first paragraph after it with p. )

Last edited by els (2008-03-24 17:30:10)

Offline

#149 2008-03-24 20:13:21

roelof
Member
Registered: 2005-03-27
Posts: 647

Re: [archived] sdr_guestbook

oke,

Thank you for the explanation and i will wait for your answer.
You are a very good person.

Roelof

Offline

#150 2008-03-24 22:31:17

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: [archived] sdr_guestbook

roelof wrote:

You are a very good person.

Not at all, I just like puzzles and to mess with plugin code :)

And I think I managed to solve this one, though it’s really risky to let me poke around in code… ;) I hope I didn’t mess up the quotes again… And I’m sure there is a better way to do it *), but this seemed to work for me. If it doesn’t work, just re-install the original plugin. And note that messy URLs are now hard-coded, if you ever want to switch to clean URLs you’ll have to revert to the original plugin.

Also, this plugin is not supported anymore, so there is always a chance that after a future TXP upgrade it will just stop working. But you can do almost the same with the core TXP comments now, except for the pagination. And that will probably be possible in the future as well.

OK, if you want to take the risk, find this line in the plugin code (under // previous link)

$pagestring .= '<li><a href="'.hu.$s.'/?page='.($page-1)."\">$previous</a></li>".n;

and replace it with

$pagestring .= '<li><a href="<txp:site_url />index.php?id=<txp:page_url type="id" />&page='.($page-1)."\">$previous</a></li>".n;

Under // dynamic page number links find

$pagestring .= '<li><a href="'.hu.$s.'/?page='.$i.'"'.">$i</a></li>".n;

and replace it with

$pagestring .= '<li><a href="<txp:site_url />index.php?id=<txp:page_url type="id" />&page='.$i.'"'.">$i</a></li>".n;

Under // next link find

$pagestring .= '<li><a href="'.hu.$s.'/?page='.($page+1)."\">$next</a></li>".n;

and replace it with

$pagestring .= '<li><a href="<txp:site_url />index.php?id=<txp:page_url type="id" />&page='.($page+1)."\">$next</a></li>".n;

*) As you can see, I don’t know PHP at all, I just put in some TXP tags ;)

Offline

#151 2008-03-25 07:41:13

roelof
Member
Registered: 2005-03-27
Posts: 647

Re: [archived] sdr_guestbook

Hello Els,

For me it isn’t working.
I get a message that a } is found on the prevoius link where it schouldn’t be.

Roelof

P.s. do you mean that the sed isn’t supported anymore or the not hacked version ?

Last edited by roelof (2008-03-25 08:07:22)

Offline

#152 2008-03-25 22:37:43

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: [archived] sdr_guestbook

roelof wrote:

P.s. do you mean that the sed isn’t supported anymore or the not hacked version ?

The original guestbook plugin is not supported anymore. I asked Sander last year or so and he doesn’t have the time to maintain it. I don’t know about Steve, but he only made some changes to make it work with sed_comment_pack, so it wouldn’t be fair to ask him to support someone else’s plugin.

About the code, something problably went wrong with copying it, because it works on my test site. Try this (disable the original plugin when you try this one, and keep a copy of the original code just in case, because the download site is down at the moment).

Last edited by els (2008-03-25 22:44:27)

Offline

#153 2008-03-26 07:40:23

roelof
Member
Registered: 2005-03-27
Posts: 647

Re: [archived] sdr_guestbook

Hello Els,

It works like a charm.
Thank you very much.

Roelof

Offline

#154 2008-03-26 09:30:07

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: [archived] sdr_guestbook

Great :)

Offline

#155 2008-04-10 08:37:20

RedFox
Member
From: Netherlands
Registered: 2005-03-25
Posts: 805
Website

Re: [archived] sdr_guestbook

A little help to style <txp:comment_message /> is needed … see this page
There is a container <div> but I can’t give it a class … or is there an other way to do this?

I use version 4.0 with modifications by Steve and Els … with TXP 4.0.5

Last edited by RedFox (2008-04-10 08:50:07)

Offline

#156 2008-04-10 20:55:54

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: [archived] sdr_guestbook

I wrapped a <div id="comments"> around the comments part of the code in my single article form.

modifications by Steve and Els

I don’t know why Steve put it like that, I just told Steve what I needed and he modified the code ;)

… with TXP 4.0.5

Upgrade :)

Last edited by els (2008-04-10 20:56:39)

Offline

  1. Index
  2. » Archives
  3. » [archived] sdr_guestbook

Board footer

Powered by FluxBB