Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

Problem mit Section / Bessere Lösung?

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Language: German
View previous topic :: View next topic  
Author Message
creative-w3
Smarty Rookie


Joined: 02 Jan 2005
Posts: 12
Location: Ammersbek, Germany

PostPosted: Sun Jan 02, 2005 10:41 am    Post subject: Problem mit Section / Bessere Lösung? Reply with quote

Hallo,

ich arbeite derzeit an meinem ersten Projekt mit Smarty und bin gerade dabei ein Array auszugeben, dass einige Messages enthält (im Grunde wie die messages in diesem Forum). Ich bekomme es aber nicht auf die Reihe, dass folgende Array als section zu durchlaufen!? Wäre super, wenn mir jemand helfen kann! Sollte ich das Array eventuell anders aufbauen (falls ja, wie und warum)?

[php:1:49c7bcfcbf]Array
(
[0] => Array
(
[id] => 1
[from_id_user] => 1
[from_nickname_user] => qwertzui
[to_read] => no
[message_title] => Deine erste Message!
[message_content] => blaaaz
[date] => 1104658367
)

[1] => Array
(
[id] => 2
[from_id_user] => 4
[from_nickname_user] => wertzuio
[to_read] => yes
[message_title] => Eine ältere Message...
[message_content] => Viel Text ...

... und nichts dahinter!
[date] => 1104650901
)

)[/php:1:49c7bcfcbf]

Viele Grüße,
André
Back to top
View user's profile Send private message Visit poster's website
creative-w3
Smarty Rookie


Joined: 02 Jan 2005
Posts: 12
Location: Ammersbek, Germany

PostPosted: Mon Jan 03, 2005 11:29 am    Post subject: Reply with quote

Hier noch einmal, wie das ursprüngliche Array aussieht:

$message[0][message_title] = "Titel der Message"
$message[0][message_content] = "Inhalt der Message"
...
$message[1][message_title] = "Noch eine Message"
$message[1][message_content] = "Mit Inhalt"
...

Jemand eine Lösung für mich?? Wink
Back to top
View user's profile Send private message Visit poster's website
CaptainE
Smarty Rookie


Joined: 23 Dec 2004
Posts: 22

PostPosted: Mon Jan 03, 2005 2:18 pm    Post subject: Reply with quote

also ich seh jetzt kein bestimmtes Problem darin, ich denk das geht ganz einfach wie folgt:

Code:
{section name=messagecount loop=$message}
 
  Am  {$message[messagecount].date|date_format:"%d.%m.%Y"} hat der Benutzer {$message[messagecount].from_nickname_user} den Beitrag mit dem Titel   {$message[messagecount].message_title} und dem folgenden Inhalt geschrieben: {$message[messagecount].message_content}
{/section}


Naja, oder halt so ähnlich vom Inhalt her. Bei mir tut das wunderbar so und man kann dann auch innerhalb dieser section noch weitere sections einfügen nach dem muster


Code:
$arrayname[counter1].schlüssel1[counter2].schlüssel2.schlüssel3[couter3].schlüssel4


und so weiter...

Hoffe konnte dir helfen[/code]
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Language: German All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP