Nummerierung Gästebucheinträge umkehren

Get help with installation and running phpwcms here. Please do not post bug reports or feature requests here.
Post Reply
_mel_
Posts: 104
Joined: Wed 20. Apr 2005, 20:35
Location: Nürnberg
Contact:

Nummerierung Gästebucheinträge umkehren

Post by _mel_ »

Hi,

kann es sein dass bei dem letzten phpwcms release die Nummerierung der Gästebucheinträge umgekehrt wurde? Bei mir ist es nun so dass der letzte und damit aktuellste Eintrag die nr. 1. hat. Bei Pepe habe ich jedoch gesehen dass es in der Regel anders ist.

Ich frage mich schon wie ich das wieder geschafft habe das so zu verändern, ich habe die default.html ziemlich umgebaut...hilfe hilfe. Kann mir jemand vielleicht einen Tipp geben wie man das wieder umstellen kann?

Lg Melanie
pepe
Posts: 3954
Joined: Mon 19. Jan 2004, 13:46

Post by pepe »

_mel_

Alles im GRÜNEN Bereich... deine Variante ist die NORMALE... ich habe meine geändert :!:

Dadurch kann ich sofort sehen, wieviele Gäste sich eingetragen haben :wink: Fand ich einfach sinnvoller!
_mel_
Posts: 104
Joined: Wed 20. Apr 2005, 20:35
Location: Nürnberg
Contact:

Post by _mel_ »

hallo Pepe! ;)

Da treffen wir uns mal wieder... ;)
TJAAAAA...Du ahnst worauf ich hinauswill :wink:
Ich hätte auch gerne eine solche Reihenfolge wie Du!
Hättest Du einen wertvollen Tipp für mich?

In ergebener Dankbarkeit

Melanie :P
frabon69
Posts: 68
Joined: Wed 25. May 2005, 13:08

Hätte ich auch gerne

Post by frabon69 »

Hallo Pepe,
wie, und wo hast du das denn jetzt eingestellt??
Find ich auch viel sinnvoller, so wie das bei Dir ist.


Viele Grüsse

frabon69
tinoo
Posts: 311
Joined: Thu 16. Jun 2005, 11:16
Location: Zürich, Switzerland
Contact:

Post by tinoo »

Hai!
Ihr müsst unter /phpwcms_template/inc_cntpart/guestbook/ die
default.html ändern, und zwar an folgender Stelle:

Code: Select all

 <!--GUESTBOOK_ENTRY_START//-->
  <tr bgcolor="#E7E7E7">
    <td width="1%" align="right"><strong>{ID}&nbsp;&nbsp;</strong></td>
    <td width="99%"> | {TIMESTAMP:d.m.Y, H:i}</td>
  </tr>
  <tr>
Ersetzen muss man das {ID} durch {DBID}.

Das ganze hat aber einen Schönheitsfehler: Die Datenbank-ID wird
fortlaufend erhöht, also auch wenn ein Eintrag gelöscht wird... Somit
stimmt die Nummerierung insbesondere am Anfang des Guestbook
nicht, denn durch Tests (Eintrag erstellen, löschen usw.) wird der
Zähler ständig erhöht... Man kann aber problemlos das Guestbook eine
Weile in Betrieb halten und dann die Vorlage ändern, wenns mal ein
paar Dutzend Einträge hat...
Greetz, tinoo
User avatar
pico
Posts: 2595
Joined: Wed 28. Jul 2004, 18:04
Location: Frankfurt/M Germany
Contact:

Post by pico »

Hi

think it is a better way to change the Listing-Code in ../include/inc_front/content/cnt18.article.inc.php

Code: Select all

	// pages listing
		for($x=$start; $x<=$end; $x++) {
			if($navpages) $navpages .= $wrap[0];
			if($x-1 != $current) {
				$navpages .= '<a href="'.$link.($x-1).$linkadd.'">';
				$navpages .= $x.'</a>';
			} else {
				$navpages .= $wrap[1].$x.$wrap[2];
			}			
		}
to (not tested)

Code: Select all

	// pages listing
		for($x=$end; $x<=$start; $x--) {
			if($navpages) $navpages .= $wrap[0];
			if($x-1 != $current) {
				$navpages .= '<a href="'.$link.($x-1).$linkadd.'">';
				$navpages .= $x.'</a>';
			} else {
				$navpages .= $wrap[1].$x.$wrap[2];
			}			
		}
Lieber Gott gib mir Geduld - ABER BEEIL DICH
Horst - find me at Musiker-Board
tinoo
Posts: 311
Joined: Thu 16. Jun 2005, 11:16
Location: Zürich, Switzerland
Contact:

Post by tinoo »

this code changes the counting of the different pages, but not the counting of the different guestbookentries. but thnx anyway
Greetz, tinoo
pierre.meli
Posts: 42
Joined: Thu 18. Nov 2004, 23:07
Location: Switzerland
Contact:

Post by pierre.meli »

@ tinoo

I followed you idea and I found a solution for the numbering problem. It works if you have only occasionally to delete messages from your guestbook - you will see why:

1. I changed the template and replaced {ID} by {DBID}
2. I arranged the order of all current entries (only 5...) manually using phphMyAdmin
3. I changed the autoindex to 6 (next number in my case) with the following code and using also phpMyAdmin:

Code: Select all

ALTER TABLE phpwcms_guestbook AUTO_INCREMENT = 6 
And this is the result:
http://meli.cc/index.php?guestbook

Cheers Pierre
Image
Post Reply