detecting latest 3 posts
-
- Regular
- Posts: 340
- Joined: Sun Jun 12, 2005 5:28 am
ok cool counter works
phew I was freaking out, cause without the counter my cool new blog was broken , I also found a smarty random function {1|rand:5} that will generate random number between 1 and 5 and i can use this to randomly show the blocks
Now the random number should not generate the same number again. lets see what it does
sanku garvin
phew I was freaking out, cause without the counter my cool new blog was broken , I also found a smarty random function {1|rand:5} that will generate random number between 1 and 5 and i can use this to randomly show the blocks
Now the random number should not generate the same number again. lets see what it does
sanku garvin
-
- Regular
- Posts: 340
- Joined: Sun Jun 12, 2005 5:28 am
-
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
I think that can be done by accessing the $smarty array somehow, or using {assign}...?
REgards,
Garvin
REgards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
-
- Regular
- Posts: 340
- Joined: Sun Jun 12, 2005 5:28 am
-
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Yeah, that's all right. But Smarty stores the current counter value somehwere in a $smarty array. You may need to ask the smarty people/documentation for more info on that, at Least I don't know much about it.
Something like http://smarty.php.net/manual/en/languag ... smarty.php.
Regards,
Garvin
Something like http://smarty.php.net/manual/en/languag ... smarty.php.
Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
-
- Regular
- Posts: 340
- Joined: Sun Jun 12, 2005 5:28 am
ok this worked
{counter assign=inc print=false}
{assign var="allow" value=0|rand:1}
{if $inc gt 1 and $inc lt 6 and $allow==1}
{$entry.plugin_display_dat}
{/if}
now i can randomly place the ads between post 1 and 6
plus i'm noticing on smarty forum, people don't like to use {counter} rather they seem to use {section}
{counter assign=inc print=false}
{assign var="allow" value=0|rand:1}
{if $inc gt 1 and $inc lt 6 and $allow==1}
{$entry.plugin_display_dat}
{/if}
now i can randomly place the ads between post 1 and 6
plus i'm noticing on smarty forum, people don't like to use {counter} rather they seem to use {section}
-
- Regular
- Posts: 340
- Joined: Sun Jun 12, 2005 5:28 am
-
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
We should have Smarty 2.6.9, I think!
Regards,
Garvin
Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
-
- Regular
- Posts: 340
- Joined: Sun Jun 12, 2005 5:28 am
-
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
I think they didn't update that release file in their release for quite some time. But I know we have 2.6.9, and that 2.6.10 doesn't have that required changes for us, so I decided to stay with a working smarty
Regards,
Garvin
Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
-
- Regular
- Posts: 340
- Joined: Sun Jun 12, 2005 5:28 am
-
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Uh, can you be more specific on your block-ID question? The have unique IDs in the database, yes...
Regards,
Garvin
Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
-
- Regular
- Posts: 340
- Joined: Sun Jun 12, 2005 5:28 am
what i meant was is that if i have like 5 blocks, and i only want to display 2 of them. So can i in my entries.tpl file directly call them. like {$entry.plugin_display_block2} or something. right now all the blocks are shown randomly, but i want to select which ones get shown randomly and whch one not random
-
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Hm, I don't know, you'll need to try. I think it must be done within the Plugin PHP code, you can build a smarty function that prints a block yourself there.
Regards,
Garvin
Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/