Zwischen Seiten blättern [SQL]

Diese Seite verwendet Cookies. Durch die Nutzung unserer Seite erklären Sie sich damit einverstanden, dass wir Cookies setzen. Weitere Informationen

  • Zwischen Seiten blättern [SQL]

    habe ein weiteres Prob... wiie mache ich das das er blättert
    meine startseite ist nun 5 km lang :P


    Quellcode

    1. <?php /* Smarty version 2.6.3, created on 2005-12-27 14:24:02
    2. compiled from forumtopics.tpl */ ?>
    3. <?php require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.load_plugins.php');
    4. smarty_core_load_plugins(array('plugins' => array(array('modifier', 'makedate', 'forumtopics.tpl', 0, false),array('function', 'makeavatar', 'forumtopics.tpl', 13, false),)), $this); ?>
    5. <?php unset($this->_sections['i']);
    6. $this->_sections['i']['loop'] = is_array($_loop=$this->_tpl_vars['topics']) ? count($_loop) : max(0, (int)$_loop); unset($_loop);
    7. $this->_sections['i']['name'] = 'i';
    8. $this->_sections['i']['show'] = true;
    9. $this->_sections['i']['max'] = $this->_sections['i']['loop'];
    10. $this->_sections['i']['step'] = 1;
    11. $this->_sections['i']['start'] = $this->_sections['i']['step'] > 0 ? 0 : $this->_sections['i']['loop']-1;
    12. if ($this->_sections['i']['show']) {
    13. $this->_sections['i']['total'] = $this->_sections['i']['loop'];
    14. if ($this->_sections['i']['total'] == 0)
    15. $this->_sections['i']['show'] = false;
    16. } else
    17. $this->_sections['i']['total'] = 0;
    18. if ($this->_sections['i']['show']):
    19. for ($this->_sections['i']['index'] = $this->_sections['i']['start'], $this->_sections['i']['iteration'] = 1;
    20. $this->_sections['i']['iteration'] <= $this->_sections['i']['total'];
    21. $this->_sections['i']['index'] += $this->_sections['i']['step'], $this->_sections['i']['iteration']++):
    22. $this->_sections['i']['rownum'] = $this->_sections['i']['iteration'];
    23. $this->_sections['i']['index_prev'] = $this->_sections['i']['index'] - $this->_sections['i']['step'];
    24. $this->_sections['i']['index_next'] = $this->_sections['i']['index'] + $this->_sections['i']['step'];
    25. $this->_sections['i']['first'] = ($this->_sections['i']['iteration'] == 1);
    26. $this->_sections['i']['last']
    27. ?>
    28. <table width="100%" cellspacing="0">
    29. <th style="text-align: left; background-color: #ffffff; color:#ffffff; font-weight:bold; padding: 5px; font-family: Verdana; font-size: 10pt; width: 70px;"><a href="<?php echo $this->_tpl_vars['boardurl']; ?>
    30. ?showuser=<?php echo $this->_tpl_vars['topics'][$this->_sections['i']['index']]['starter_id']; ?>
    31. "><?php echo $this->_tpl_vars[''][$this->_sections['i']['index']]['starter_name']; ?>
    32. </a></th>
    33. <th style="text-align: left; background-color: #ffffff; color:#ffffff; font-weight:bold; padding: 5px; font-family: Verdana; font-size: 10pt;"><a href="<?php echo $this->_tpl_vars['boardurl']; ?>
    34. ?showtopic=<?php echo $this->_tpl_vars['topics'][$this->_sections['i']['index']]['tid']; ?>
    35. "><?php echo $this->_tpl_vars['topics'][$this->_sections['i']['index']]['title']; ?>
    36. </a>
    37. (<?php echo $this->_tpl_vars['lang']['posts_started_at']; ?>
    38. <?php echo ((is_array($_tmp=$this->_tpl_vars['topics'][$this->_sections['i']['index']]['post_date'])) ? $this->_run_mod_handler('makedate', true, $_tmp, 'post_date') : makedate($_tmp, 'post_date')); ?>
    39. )
    40. </th></tr>
    41. <tr>
    42. <td style="text-align: center; background-color: #ffffff; color:#ffffffC; font-weight:bold; padding: 5px; font-family: Verdana; font-size: 10pt; width: 70px;">
    43. </td>
    44. <td style="background-color: #ffffff; font-family: Verdana; font-size: 10pt; padding: 5px;">
    45. <?php echo $this->_tpl_vars['topics'][$this->_sections['i']['index']]['post']; ?>
    46. <br /><br />
    47. <?php echo $this->_tpl_vars['lang']['posts_comments']; ?>
    48. <strong><?php echo $this->_tpl_vars['topics'][$this->_sections['i']['index']]['posts']; ?>
    49. </strong> :: <?php echo $this->_tpl_vars['lang']['posts_views']; ?>
    50. <strong><?php echo $this->_tpl_vars['topics'][$this->_sections['i']['index']]['views']; ?>
    51. </strong> :: <a href="<?php echo $this->_tpl_vars['boardurl']; ?>
    52. ?showtopic=<?php echo $this->_tpl_vars['topics'][$this->_sections['i']['index']]['tid']; ?>
    53. ">
    54. </a>
    55. <?php if ($this->_tpl_vars['topics'][$this->_sections['i']['index']]['posts']): ?>
    56. :: <?php echo $this->_tpl_vars['lang']['posts_last_comments']; ?>
    57. <strong><a href="<?php echo $this->_tpl_vars['topics'][$this->_sections['i']['index']]['last_poster_profile_link']; ?>
    58. "><?php echo $this->_tpl_vars['topics'][$this->_sections['i']['index']]['last_poster_name']; ?>
    59. </a></strong> at <strong><?php echo ((is_array($_tmp=$this->_tpl_vars['topics'][$this->_sections['i']['index']]['last_post'])) ? $this->_run_mod_handler('makedate', true, $_tmp, 'last_post') : makedate($_tmp, 'last_post')); ?>
    60. </strong>
    61. <?php endif; ?>
    62. </td></tr>
    63. </table>
    64. <br />
    65. <?php endfor; endif; ?>
    Alles anzeigen



    gruss

    sascha
  • PS: Ich behalte mir mal vor, für deine einzelnen fragen neue threads zu erstellen.. da behält ja keiner einen überblick, wenn man in einem thread 4 fragen abhandelt

    dein code ist ja offensichtlich schon so ausgelegt, dass man blättern kann:
    einfach die startvariable ändern..

    http://board.stagate.info/ssi.php?m=posts&a=forumtopics&forum=2&start=0&show=5

    du willst also nur ein paar links einbauen?
    dazu musst du einfach ne schleife schreiben! z.b. so...

    Quellcode

    1. $steps = 5;
    2. for($i=0; $i<$this->_sections['i']['total']; $i+=$steps)
    3. $output .= '<a href="...?start=$i">'.$i.'</a>';
  • brauchst doch nur die url ergänzen..
    in welchen variablen, welcher dateipfad steckt kann ich dir auch nicht sagen

    kannst ja mal die werte von "_tpl_vars" und "_sections" posten

    oder mach dir die sache einfach und nimm den folgenden link in der schleife:

    Quellcode

    1. $link = '/ssi.php?m=posts&a=forumtopics&forum='.$_GET['forum'].'&start='.$i.'&show='.$steps;
  • hier mein vorheriges post im anderen thread:

    wahrscheinlich gibt es in der smarty konfiguration irgendwo eine einstellung dafür.

    wenn nicht, muss man es wohl manuell machen. das prinzip ist das, dass man schleifenbedingung und -anfangszustand verändert.

    anfangszustand steht wahrscheinlich in dieser zeile:

    Quellcode

    1. $this->_sections['i']['first'] = ($this->_sections['i']['iteration'] == 1);


    Die Voraussetzung vielleicht das hier:

    Quellcode

    1. $this->_sections['i']['last']


    :?:
  • Na fehler noch keine weiss ich nicht wirklich weiss wie ich vrgehen soll

    germeshausen benutzt das auch dieses ssi plus und bei denen blättert er immer das allte nach hinten und das neue nach vorne siehe http://germeshausen.de

    ich würde das auch gerne so machen nur ich weiss auch nicht wirklich wo ich es einfügen soll diesen code in dem ssiplus selber oder auf meiner seite

    ich blick da nicht wirklich durch das einzigste was germeshausen mir da veraten hat ist das die es mit macromedia dreamwaver gemacht haben nur wie das sagen die natürlich nicht verständlich


    Gruss

    Sascha
  • also um nochmal auf die blätterfunktion zurück zu kommen das funst net

    habe das in diese datei eingefügt beide cods die du mir geschrieben hast hat beides nicht geklappt die startseite ist trozdem 5 kmlang

    Ich weiss da nicht mehr weiter :cry:


    habe einmal so versucht

    PHP-Quellcode

    1. <?php /* Smarty version 2.6.3, created on 2005-12-27 14:24:02
    2. compiled from forumtopics.tpl */ ?>
    3. /* ... zur übersicht gekürzt ... */
    4. <?
    5. $steps = 2;
    6. for($i=0; $i<$this->_sections['i']['total']; $i+=$steps)
    7. $output .= '<a href="home2.htm=$i">'.$i.'</a>';
    8. ?>






    und einmal so


    PHP-Quellcode

    1. <?php /* Smarty version 2.6.3, created on 2005-12-27 14:24:02
    2. compiled from forumtopics.tpl */ ?>
    3. /* ... zur übersicht gekürzt ... */
    4. <?
    5. $steps = 5;
    6. for($i=0; $i<$this->_sections['i']['total']; $i+=$steps) {
    7. echo '<a href="/ssi.php?m=posts&a=forumtopics&forum='.$_GET['forum'].'&start='.$i.'&show='.$steps.'">'.$i.'</a>';
    8. }
    9. ?>
    Alles anzeigen


    aber leider auch vergebens
  • bis auf meinen code in den letzten zeilen wurde aber nichts geändert, oder?

    die links zum blättern funktionieren doch "fast"..
    du musst nur die "startseite" richtig verlinken
    nämlich mit
    http://board.stagate.info/ssi.php?m=posts&a=forumtopics&forum=2&start=0&show=5

    aber hast du wirklich i += $steps im einsatz
    dadurch sollte i eigentlich in 5er schritten erhöht werden

    Quellcode

    1. <?
    2. $steps = 5;
    3. for($i=0; $i<$this->_sections['i']['total']; $i+=$steps) {
    4. echo '<a href="/ssi.php?m=posts&a=forumtopics&forum='.$_GET['forum'].'&start='.$i.'&show='.$steps.'">'.($i/$steps).'</a>';
    5. }
    6. ?>
  • ja das mit dem blättern haben wir da nich nicht ganz hinbekommen und wir musten den code ein bisel verändern


    <?php /* Smarty version 2.6.3, created on 2005-12-27 14:24:02
    compiled from forumtopics.tpl */ ?>

    /* ... zur übersicht gekürzt ... */

    <?php
    $steps = 5;
    for($i=1; $i<$this->_sections['i']['total']; $i++) {
    echo '<a href="http://board.stagate.info/ssi.php?m=posts&a=forumtopics&forum='.$_GET['forum'].'&start='.$i.'&show='.$steps.'">'.$i.'</a>';
    }
    ?>
    </div>



    bin aber immernoch nit fertig also da fehlt noch einiges


    hatte grade deinen neuen code ausprobiert dann kam diese fehlermeldung

    Warning: Division by zero in /var/www/virtual/stagate.info/board/htdocs/ssiplus/compiled/%%16^166^166515E3%%forumtopics.tpl.php on line 72
  • manchmal treibst du einen echt zur weißglut :)
    wie soll ich denn den fehler finden, wenn du einen anderen code postest als du tatsächlich verwendest..
    glücklicherweise war es hier offensichtlich

    also hier nochmal ein aktualisierter code
    da die schleife bei 0 beginnt, darf man im ersten durchgang nicht teilen

    Quellcode

    1. <?
    2. $steps = 5;
    3. for($i=0; $i<$this->_sections['i']['total']; $i+=$steps) {
    4. $showline = $i > 0 ? ($i/$steps)+1 : 1;
    5. echo '<a href="/ssi.php?m=posts&a=forumtopics&forum='.$_GET['forum'].'&start='.$i.'&show='.$steps.'">'.$showline.'</a> ';
    6. }
    7. ?>