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

Zufallszahl ohne Plugin?

 
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
SoundOfSilence88
Smarty n00b


Joined: 24 Oct 2012
Posts: 1

PostPosted: Wed Oct 24, 2012 9:17 am    Post subject: Zufallszahl ohne Plugin? Reply with quote

Hi Leute...
ich bin neu hier und hab auch gleich eine Frage:

Ich habe vor die Artikelboxen verschieden zu gestalten. Dabei sollen diese zufällig bei jedem neu laden ausgegeben werden. so zu sagen.
Es soll also wie folgt aussehen:

Artikelbox 1 hat Nummer 3
Artikelbox 2 hat Nummer 6
Artikelbox 3 hat Nummer 1

und beim nächsten laden dann

Artikelbox 1 hat Nummer 2
Artikelbox 2 hat Nummer 1
Artikelbox 3 hat Nummer 5

dass ich quasi ohne viel Aufwand den Hintergrund da ändern kann....
Allerdings möchte ich das ganze nicht unbedingt mit einem Plugin machen.
Kann mir da jemand helfen?

LG
Sound of Silence 88
Back to top
View user's profile Send private message
Grizzly
Smarty Pro


Joined: 15 Apr 2011
Posts: 172
Location: Germany

PostPosted: Thu Oct 25, 2012 6:24 am    Post subject: Reply with quote

Ja wie wird denn der Inhalt der "Artikelbox" ausgegeben? Mittels Code oder nicht? Wenn ja, dann kannst dus ja dort machen Wink

Ansonsten habe ich folgendes im inet gefunden:

Code:
{assign var='random' value=1|rand:n}


Musst n nur mit der Zahl austauschen, die die höchste zufallszahl sein darf. zum Beispiel 10. Dann bekommst du zufallswerte zwischen 1 und 10
Back to top
View user's profile Send private message Visit poster's website
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