Jump to content
InvisionCommunity.de - Der Deutsche Invision Community Support
Sign in to follow this  
Dragon4048

Wie baut man eine blätterfunktion ein

Recommended Posts

Hallo zusamen,

ich habe dam maleine dringende frage undzwar ich habe bei meinem forum das ssiplus im einsatz womit man die datenbak auslesen kann um die news auf der Homeage anzeigen zu lassen nun habe ich volgenes Problem wie kann ich bei mireine blätterfunktion einbauen den so ist meine start und news seite 5 km lang man sagte mir mal das dies wohl mit dreamweaver gemacht wird allerdings weiss ich nicht wie hätte da vieleicht einer ne idee?

Wäre sehr net :rolleyes:

Mit Freundlichen Grüssen

Dragon

Share this post


Link to post

a) kommt mir die Frage bekannt vor

B) meine ich sie vor kurzem beantwortet zu haben

c) wiederhole ich mich nicht - oder zumindest nicht gerne ;)

d) wenn ich dir jetzt den PHP Code meine blaettern.lib.php poste könntest du damit wohl auch nichts anfangen

Edit:

und e) vote 4

b)

kein Smiley Tag mehr!

Edited by Modula

Share this post


Link to post

doch damit könnte ich sehr viel anfangen desweiteren hatte zu dem zeitpunkt mir keiner drauf geatwortet und in der suche hab ich vorhin nichts gefunden wäre net wenn du mir dies mal erklären könntes da ich alles schon versucht habe esaber nicht hinbekomme

das einzigste was du gesagt hast ist das ich es begrenzen kann ich möchte dies aber nicht begrenzen sondern das er es blätter und dies weiss ich leider nicht wie dies geht :(

Edited by Dragon4048

Share this post


Link to post

habe einmal so versucht

<?php /* Smarty version 2.6.3, created on 2005-12-27 14:24:02

         compiled from forumtopics.tpl */ ?>

<?php require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.load_plugins.php');

smarty_core_load_plugins(array('plugins' => array(array('modifier', 'makedate', 'forumtopics.tpl', 0, false),array('function', 'makeavatar', 'forumtopics.tpl', 13, false),)), $this); ?>

<?php unset($this->_sections['i']);

$this->_sections['i']['loop'] = is_array($_loop=$this->_tpl_vars['topics']) ? count($_loop) : max(0, (int)$_loop); unset($_loop);

$this->_sections['i']['name'] = 'i';

$this->_sections['i']['show'] = true;

$this->_sections['i']['max'] = $this->_sections['i']['loop'];

$this->_sections['i']['step'] = 1;

$this->_sections['i']['start'] = $this->_sections['i']['step'] > 0 ? 0 : $this->_sections['i']['loop']-1;

if ($this->_sections['i']['show']) {

    $this->_sections['i']['total'] = $this->_sections['i']['loop'];

    if ($this->_sections['i']['total'] == 0)

        $this->_sections['i']['show'] = false;

} else

    $this->_sections['i']['total'] = 0;

if ($this->_sections['i']['show']):


            for ($this->_sections['i']['index'] = $this->_sections['i']['start'], $this->_sections['i']['iteration'] = 1;

                 $this->_sections['i']['iteration'] <= $this->_sections['i']['total'];

                 $this->_sections['i']['index'] += $this->_sections['i']['step'], $this->_sections['i']['iteration']++):

$this->_sections['i']['rownum'] = $this->_sections['i']['iteration'];

$this->_sections['i']['index_prev'] = $this->_sections['i']['index'] - $this->_sections['i']['step'];

$this->_sections['i']['index_next'] = $this->_sections['i']['index'] + $this->_sections['i']['step'];

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

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

?>

<table width="100%" cellspacing="0">



<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']; ?>

?showuser=<?php echo $this->_tpl_vars['topics'][$this->_sections['i']['index']]['starter_id']; ?>

"><?php echo $this->_tpl_vars[''][$this->_sections['i']['index']]['starter_name']; ?></a><a href="<?php echo $this->_tpl_vars['boardurl']; ?>

?showtopic=<?php echo $this->_tpl_vars['topics'][$this->_sections['i']['index']]['tid']; ?>

"><?php echo $this->_tpl_vars['topics'][$this->_sections['i']['index']]['title']; ?>

</a>


(<?php echo $this->_tpl_vars['lang']['posts_started_at']; ?>

 <?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')); ?>

)</th>

</tr>

<tr>


<td style="background-color: #ffffff; font-family: Verdana; font-size: 10pt; padding: 5px;">


<?php echo $this->_tpl_vars['topics'][$this->_sections['i']['index']]['post']; ?>



<br /><br />


<?php echo $this->_tpl_vars['lang']['posts_comments']; ?>

 <strong><?php echo $this->_tpl_vars['topics'][$this->_sections['i']['index']]['posts']; ?></strong>  <?php echo $this->_tpl_vars['lang']['posts_views']; ?>

 <strong><?php echo $this->_tpl_vars['topics'][$this->_sections['i']['index']]['views']; ?></strong>  <a href="<?php echo $this->_tpl_vars['boardurl']; ?>

?showtopic=<?php echo $this->_tpl_vars['topics'][$this->_sections['i']['index']]['tid']; ?>

">



</a></td>

</tr>

</table>


<br />


<?php endfor; endif; ?>


<? 

$steps = 2; 

for($i=0; $i<$this->_sections['i']['total']; $i+=$steps) 

$output .= '<a href="home2.htm=$i">'.$i.'</a>';

?>
und einmal so
<?php /* Smarty version 2.6.3, created on 2005-12-27 14:24:02

         compiled from forumtopics.tpl */ ?>

<?php require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.load_plugins.php');

smarty_core_load_plugins(array('plugins' => array(array('modifier', 'makedate', 'forumtopics.tpl', 0, false),array('function', 'makeavatar', 'forumtopics.tpl', 13, false),)), $this); ?>

<?php unset($this->_sections['i']);

$this->_sections['i']['loop'] = is_array($_loop=$this->_tpl_vars['topics']) ? count($_loop) : max(0, (int)$_loop); unset($_loop);

$this->_sections['i']['name'] = 'i';

$this->_sections['i']['show'] = true;

$this->_sections['i']['max'] = $this->_sections['i']['loop'];

$this->_sections['i']['step'] = 1;

$this->_sections['i']['start'] = $this->_sections['i']['step'] > 0 ? 0 : $this->_sections['i']['loop']-1;

if ($this->_sections['i']['show']) {

    $this->_sections['i']['total'] = $this->_sections['i']['loop'];

    if ($this->_sections['i']['total'] == 0)

        $this->_sections['i']['show'] = false;

} else

    $this->_sections['i']['total'] = 0;

if ($this->_sections['i']['show']):


            for ($this->_sections['i']['index'] = $this->_sections['i']['start'], $this->_sections['i']['iteration'] = 1;

                 $this->_sections['i']['iteration'] <= $this->_sections['i']['total'];

                 $this->_sections['i']['index'] += $this->_sections['i']['step'], $this->_sections['i']['iteration']++):

$this->_sections['i']['rownum'] = $this->_sections['i']['iteration'];

$this->_sections['i']['index_prev'] = $this->_sections['i']['index'] - $this->_sections['i']['step'];

$this->_sections['i']['index_next'] = $this->_sections['i']['index'] + $this->_sections['i']['step'];

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

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

?>

<table width="100%" cellspacing="0">



<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']; ?>

?showuser=<?php echo $this->_tpl_vars['topics'][$this->_sections['i']['index']]['starter_id']; ?>

"><?php echo $this->_tpl_vars[''][$this->_sections['i']['index']]['starter_name']; ?></a><a href="<?php echo $this->_tpl_vars['boardurl']; ?>

?showtopic=<?php echo $this->_tpl_vars['topics'][$this->_sections['i']['index']]['tid']; ?>

"><?php echo $this->_tpl_vars['topics'][$this->_sections['i']['index']]['title']; ?>

</a>


(<?php echo $this->_tpl_vars['lang']['posts_started_at']; ?>

 <?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')); ?>

)</th>

</tr>

<tr>


<td style="background-color: #ffffff; font-family: Verdana; font-size: 10pt; padding: 5px;">


<?php echo $this->_tpl_vars['topics'][$this->_sections['i']['index']]['post']; ?>



<br /><br />


<?php echo $this->_tpl_vars['lang']['posts_comments']; ?>

 <strong><?php echo $this->_tpl_vars['topics'][$this->_sections['i']['index']]['posts']; ?></strong>  <?php echo $this->_tpl_vars['lang']['posts_views']; ?>

 <strong><?php echo $this->_tpl_vars['topics'][$this->_sections['i']['index']]['views']; ?></strong>  <a href="<?php echo $this->_tpl_vars['boardurl']; ?>

?showtopic=<?php echo $this->_tpl_vars['topics'][$this->_sections['i']['index']]['tid']; ?>

">



</a></td>

</tr>

</table>


<br />


<?php endfor; endif; ?>


<? 

$steps = 5; 

for($i=0; $i<$this->_sections['i']['total']; $i+=$steps) { 

echo '<a href="/ssi.php?m=posts&a=forumtopics&forum='.$_GET['forum'].'&start='.$i.'&show='.$steps.'">'.$i.'</a>'; 

} 

?>

aber leider auch vergebens

Share this post


Link to post

*seufz*

also gut.

Ich hänge mein Objekt samt Demo mal an - wie das im Einsatz ausschaut siehst du hier.

Wenn du gezielt Fragen stellst kann ich sie dir auch beantworten. Ein "Und wie setz ich das nun bei mir ein?" hingegen nicht.

Mit ssiplus arbeite ich und werde ich wohl auch erstmal nicht arbeiten, kenne davon also den Code nicht.

Dein Code fällt in die Kategorie "nicht lesbar" weswegen ich mir nicht die Mühe machen werde und nicht versuchen werde ihn zu verstehen.

Was (meiner Meinung nach) lesbarer Code ist siehst du an der blaettern.lib.php im Archiv.

Ein paar wichtige Regeln vielleicht mal so:

1. Ich habs früher auch nicht gemacht, aber heute könnt ich nicht mehr ohne: Kommentier deinen Code!!

2. Wenn man seinen Code schon nicht kommentiert, dann rück ihn wenigstens ein, so dass man zumindest die optische Stütze hat.

Share this post


Link to post

so ich habe das blättern hinbekommen

Nun habe ich aber noch eine kleinischkeit undzwar dieser code löst bei mir auf der seite die zahlen ganz unten aus 1 - 2 - 3 usw

Hier der code

<div align="center"><br/> 


<?php 

$steps = 10; 

for($i=0; $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>

ist es möglich in diesem code das ihrgend we einzubauen das die zahlen in weiss angezigt werden den dann sind die nicht mehr sichtbar auf meiner seite da ich zum blätern meine eigenen zahlken nutzen muss

Gruss

Dragon

Share this post


Link to post

Also - wenn du die Navigation der blaettern.lib.php nicht brauchst, dann brauchst du an und für sich die komplette Datei nicht, da sie lediglich diese Navigation erzeugt...

Ansonsten kannst du die Formatierungen in der blaettern.lib.php einstellen (ist alles kommentiert)

Um die Navi nicht anzuzeigen nimm einfach die Zeile <?php echo $nave; ?> raus.

Share this post


Link to post

Ah Danke dir hat wunderbar geklappt würde ja gerne deine datei nutzen allerdings weiss ich nicht wie ich es damit machen soll bin mit php nicht so fit wie du

aber kennst du vieleicht noch einen code womit man einen onlinestaus anzeigen kann?

Z.b Benutzer Online 4

Da ich ungerne diese gratis counter benutze

Mit Freundlichen Grüssen

Dragon

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

×