detecting latest 3 posts
-
- Regular
- Posts: 340
- Joined: Sun Jun 12, 2005 5:28 am
detecting latest 3 posts
basically this is what i want
detect the latest 3 posts.
put ad below the third one.
So no matter what happens the ad always appears after the 3 latest post
Perhaps this feature can be added to Html nugget. where a nugget can be placed after a specified number of posts
detect the latest 3 posts.
put ad below the third one.
So no matter what happens the ad always appears after the 3 latest post
Perhaps this feature can be added to Html nugget. where a nugget can be placed after a specified number of posts
-
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Re: detecting latest 3 posts
Look at serendipity_event_includeentry. It's basic usage was documented/announced on blog.s9y.org some time. It does what you want.
Best regards,
Garvin
Best 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
you are talking about this
http://blog.s9y.org/archives/49-Include ... lugin.html
I don't get how it will do what i want it to do.
I installed it. It can install a block under my entries and stuff by copying other body or extended entry.
How do i use it to add ads.
http://blog.s9y.org/archives/49-Include ... lugin.html
I don't get how it will do what i want it to do.
I installed it. It can install a block under my entries and stuff by copying other body or extended entry.
How do i use it to add ads.
-
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
You just put your adds into a content block, and then include your content block
A content block can contain any HTML/Javascript code, so Ads in there are no problem.
Regards,
Garvin
A content block can contain any HTML/Javascript code, so Ads in there are no problem.
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:
Yes, but the includeentry plugin works like that!
It adds a new item like the static pages menu item to your blog: "Template Blocks".
This panel from the plugin is broken up in two sections: Templates and Blocks. Templates can be used to create a new entry based from a template. Something like a draft article you can re-use for creating entries.
The rightmost section is where you maintain Blocks. Create a block and insert content (= your Ad-Code).
In the config of the includeentry plugin you can define "Show random blocks" to "Yes". This will show a random block after X entries in your blog. Of course you can also only have one random block with Ads, which will always be shown.
One can do it with templating as well, but I think the easier approach is the plugin.
It's hard to explain the plugin (I'm not a writer), but once you use it, it should get obvious.
Regards
Garvin
It adds a new item like the static pages menu item to your blog: "Template Blocks".
This panel from the plugin is broken up in two sections: Templates and Blocks. Templates can be used to create a new entry based from a template. Something like a draft article you can re-use for creating entries.
The rightmost section is where you maintain Blocks. Create a block and insert content (= your Ad-Code).
In the config of the includeentry plugin you can define "Show random blocks" to "Yes". This will show a random block after X entries in your blog. Of course you can also only have one random block with Ads, which will always be shown.
One can do it with templating as well, but I think the easier approach is the plugin.
It's hard to explain the plugin (I'm not a writer), but once you use it, it should get obvious.
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/
-
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Hi!
Best regards,
Garvin
Yes, we need people to code spartacus.s9y.org (like pear.php.net) with a detailed plugin overview!<rant>
This is one of MY biggest complaints about S9Y - how chaotic the plugin organization is !!
Hm, well I think then we have different opinions on that - I find it very related A main reason of course was not to clutter up the plugin repository too much by creating another plugin that has 50% of the needed functionality duplicated. If you look at the code, the two ways the plugin works are technically very related...I don't know why the "entry templates and random nuggets" plugin is a part of the include entry plugin. From my viewpoint they are completely unrelated functions. I would never think to try something called "Markup: Include entry data/templates/blocks" if I needed to insert stuff BETWEEN entries.
Yes, you can do that with [s9y-include-block:....] inside the markup...I assume that there is a reason to have them bundled like this....maybe you can include these "blocks" in actual entries by using include markup syntax?
Best 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:
MSB: You can modify the plugin with PHP code *g*
It sounds like nice features, but it really not little work to implement that.
Best regards,
Garvin
It sounds like nice features, but it really not little work to implement that.
Best 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
For not allowing ads after 5 posts i can use what roba said
then the same method to display 1 google ad after the first post and then randomly place chitika between 2 to 4 th post using include entry and skipping 2 entries.
not an elegant solution but should do the job
Code: Select all
{foreach name=entryloop from=$entries item="dategroup"}
{if $smarty.foreach.entryloop.index<5 and $smarty.foreach.entryloop.index!=0}
{$entry.plugin_display_dat}
{/if}
not an elegant solution but should do the job
-
- Regular
- Posts: 340
- Joined: Sun Jun 12, 2005 5:28 am
Roba it doesn't seem to work. the index goes back to 0. I cannot figure out why. I have placed it inside the inner forloop. so i guess the inner loop ends and then starts again. the loop is date dependent. any way to change it so it isn't date dependent
The outer forloop is stuck at (-1) why is it minus
Also garvin It doesn't randomly place the blocks. It randomly selects which blocks to place. but not randomly select where to place. right now its is showing one single block after all the entries.
The outer forloop is stuck at (-1) why is it minus
Also garvin It doesn't randomly place the blocks. It randomly selects which blocks to place. but not randomly select where to place. right now its is showing one single block after all the entries.
-
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Hi!
I'm sorry, but I have no time or intention to fix this at least within the next 4 weeks...I think in most cases this is just extra flexibility that isn'T so much needed. And you might get it to work with extra Smarty coding...
Regards,
Garvin
I never said it would randomly place blocks. With "random placement" I mean exactly what you describe: The block to show is randomized. The position where it appears is fixed.Also garvin It doesn't randomly place the blocks. It randomly selects which blocks to place. but not randomly select where to place. right now its is showing one single block after all the entries.
I'm sorry, but I have no time or intention to fix this at least within the next 4 weeks...I think in most cases this is just extra flexibility that isn'T so much needed. And you might get it to work with extra Smarty coding...
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
garvin can u give me a counter that counts from 0 to end of all the posts and doesn't reset. right now the counter runs per day and resets for next day. So if i have 2 post today and 3 yesterday, the the counter goes from 0 to 1 and resets back to zero and goes from 0 to 2, it doesn't go from 0 to 4
-
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
MSB: You can add that yourself in your entries.tpl or whatever template. Check the Smarty documentation for {counter} and/or for {foreach}, which always sets running indices.
The entries.tpl has two loops, so you need to get the counter value of the outmost loop, not the inner loop.
Regards,
Garvin
The entries.tpl has two loops, so you need to get the counter value of the outmost loop, not the inner loop.
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