Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#61 2005-06-04 23:16:48
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: [archived] sdr_guestbook
JoeyNL, it might be this:
In function sdr_discuss find this line:
<code>$commentsul = (!empty($commentsul)) ? ‘id=’.$commentsul : “”;</code>
<br />
What I have in my code is this:
<br />
<code>$commentsul = (!empty($commentsul)) ? ‘id=”’.$commentsul : ‘”’;</code>
<br />
and my page validates, so that’s probably what you have to change.
(Please let me know if I’m talking sense here, I wouldn’t know…)
Offline
#62 2005-06-05 07:37:58
- Joey
- Member
- From: Netherlands
- Registered: 2005-01-19
- Posts: 257
Re: [archived] sdr_guestbook
> doggiez wrote:
> <code>$commentsul = (!empty($commentsul)) ? ‘id=”’.$commentsul : ‘”’;</code>
Okay, I did that, but is still isn’t closing my tag and then, of course, it does not validate.
Its still outputting: < ul id=“gastcom>
Last edited by JoeyNL (2005-06-05 07:56:10)
Regards,
Joey
Offline
#63 2005-06-05 12:12:02
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: [archived] sdr_guestbook
> JoeyNL wrote:
> Okay, I did that, but is still isn’t closing my tag and then, of course, it does not validate.
Its still outputting: < ul id=“gastcom>
Sorry, you’re right. I’m not good with quotes. And I had not noticed because I didn’t use the commentsul.
I solved it by hardcoding the commentsul, I changed
<code>$out.= “<br /><ul $commentsul>\n”;</code>
(mind that the original code is <code>$out.= “<br />$pagestring<ul $commentsul>\n”;</code> but I moved the paging)
into
<code>$out.= ‘<br /><ul id=“yourcommentsulid”>’;</code>
Offline
Re: [archived] sdr_guestbook
I think all the paging links are knackered as well doggiez. They are all missing the “quotes” in the href.
Stuart
In a Time of Universal Deceit
Telling the Truth is Revolutionary.
Offline
#65 2005-06-05 15:35:27
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: [archived] sdr_guestbook
Stuart,
Yes I know. I did something to the code for paging as well, some time ago, and the problem is I don’t remember (or even understand) what I did. But my page validates, so if you want my code let me know.
Offline
#66 2005-06-05 15:49:55
- Joey
- Member
- From: Netherlands
- Registered: 2005-01-19
- Posts: 257
Re: [archived] sdr_guestbook
Wow…my page finally validates :) thnx.
Last question: how can I change the Next/Previous buttons? So the next button is on the right side?
Regards,
Joey
Offline
#67 2005-06-05 15:59:36
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: [archived] sdr_guestbook
If I remember well, I changed the order in the code for paging. So now I have this order:
// previous link
…code…
// dynamic page number links
…code…
// next link
…code…
Offline
#68 2005-06-05 16:05:20
- Joey
- Member
- From: Netherlands
- Registered: 2005-01-19
- Posts: 257
Re: [archived] sdr_guestbook
Hmm on second thought editing this plugin is quite easy ;-)
Regards,
Joey
Offline
Re: [archived] sdr_guestbook
Slight adjustment to the code above provides quotes around the communtsul and pageul
approx line 12 <code> $pageul = (!empty($pageul)) ? ‘id=”’.$pageul.’”’ : “”;</code>
approx line 159: <code> $commentsul = (!empty($commentsul)) ? ‘id=”’.$commentsul.’”’ : “”; </code>
TXP Builders – finely-crafted code, design and txp
Offline
#70 2005-06-11 18:25:31
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: [archived] sdr_guestbook
Thank you!!
Offline
Re: [archived] sdr_guestbook
No problem doggiez. I borrowed your mod too and made one modification to your code so that the page numbering only shows up if more than one page exists to avoid a stray “1” hanging around.
I just wrapped all your code in an if statement i.e. additions to first and last line.
<pre><code> $space = “ ”;
if ($pagenums>1) { // show page numbering only if more than one page exists
$pagestring =”<h5>”; // previous link if ($page>1) { $pagestring .= “<a href=\”/”.$s.”/?page=”.($page-1).”\”>«</a>”.$space.$space.”\n”; } // dynamic page number links for ($i=1; $i<=$pagenums; $i++) { if ($i!=$page) { $pagestring .= “<a href=\”/”.$s.”/?page=$i\”>$i</a> ”; } else { $pagestring .= “<strong>$i</strong> ”; } } // next link if ($page<$pagenums) { $pagestring .= “<a href=\”/”.$s.”/?page=”.($page+1).”\”>»</a>”.$space.$space.”\n”; } $pagestring .=’</h5>’; // end comments paging} // end page numbering only if more than one page
</code></pre>
Last edited by jakob (2005-06-12 10:33:11)
TXP Builders – finely-crafted code, design and txp
Offline
#72 2005-06-12 10:54:11
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: [archived] sdr_guestbook
Wow, perfect! On my own site in the meantime I did reach page 2 :) but I can sure use this on other sites.
Thanks!
Offline