Support Forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
plugins-topic
How to place ads in 5.0?
Avatar
Dave
Member
sp_UserOfflineSmall Offline
Jan 20, 2012 - 9:28 am

Yellow Swordfish said

Wow - that was harsher than I was 🙂

Sorry, maybe the tone just struck me the wrong way.

I, for one, understand (and appreciate) the work that goes into a project like this. Literally thousands of hours of your own time that you have given to a project, and those who use it, for pennies on the hour (if you're lucky). Hours you could have spent with loved ones, fixing holes in your socks, or cutting your grass.

You obviously aren't in it for the money and some people just don't appreciate the hard work and dedication you've contributed to the project!

Now, had violent came back and simply stated there was a lack of understanding, instead of being demanding and trashing the software, I'm sure my reply would have been a little more cordial.

Again, sorry - to everyone, violent23 included - if I went a tad overboard!

I'll go a step further! If you install the ad injection plugin and tell me what SP theme you're using I'll add the code and attach it to a post so that you can upload it to your server.

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Jan 20, 2012 - 9:39 am

Now there's an offer I wouldn't refuse.

andy-signature.png
YELLOW
SWORDFISH
Avatar
Brandon
U.S.
SP Wrangler
Free Members
sp_UserOfflineSmall Offline
Jan 20, 2012 - 11:01 am

Dave H said

I'll tell you what I do as an example...

I use the Ad Injection plugin for WP. It automatically inserts ads into posts and pages based on criteria and positions that you set, but it also gives you code that you can insert anywhere. So I insert the code for random ads - if (function_exists('adinj_print_ad')){adinj_print_ad('random'); } - in the spTopicView.php file directly before the post loop. This gives me an ad at the top of each topic.

 

That's a great tip Dave. I use a similar random ad WP plugin. I was thinking about creating a new function to display ads or any other info but using your tip I can use the ad plugin instead. Since the ad plugin will put in anything you create it could be an advertisement or any other text/problem-with-post-edit-buttontml I want.

Avatar
rocklandusa
Member
Free Members
sp_UserOfflineSmall Offline
Jan 29, 2012 - 1:45 pm

violent23 said

I was looking at the wiki and it says to use hooks that are located here "simple-forum/forum/problem-with-post-edit-buttonooks/sf-hook-template.txt" this does not exist in 5.0. Where are the hooks, and how do I put advertisements in Simple Press?

Here is how I include Google Adsense into Simple Press 5.0. May not be the most efficient way, but it works and I feel it is non-obtrusive. I have no idea what the other WP plug-in is. Just like to pop the Adsense right into the HTML. I have attached what mine looks like.

1. Go find the templates directory. I am using the Default theme. It is in the sp-resources directory. Mine is /wp-content/sp-resources/forum-themes/default/templates

2. You will be editing the spHead.php file. Load that up.

3. Under the 'Start the userInfo section' look for the line that says sp_LastVisitLabel

4. My code now looks like this (with my adsense account number x'd out)

sp_LastVisitLabel('tagClass=spLabelSmall spRight', __sp('<table width=468><tr><td align=right>Last visited %LASTVISIT% <br /><br /><br /> <script type="text/javascript"><!--

google_ad_client = "ca-pub-01234567890123";

/* TOP_RIGHT_JUNKS2012 */

google_ad_slot = "0123456789";

google_ad_width = 468;

google_ad_height = 60;

//-->

</script>

<script type="text/javascript"

src="http://pagead2.googlesyndication.com/pagead/show_ads.js">

</script></td></tr></table>'));

The result is this:

simplepress-ads.jpgImage Enlarger

 

You can view it at http://junks.tv/message-board/.....reen-room/

Avatar
rocklandusa
Member
Free Members
sp_UserOfflineSmall Offline
Jan 29, 2012 - 1:48 pm

The original code line for the above change was this:

sp_LastVisitLabel('tagClass=spLabelSmall spRight', __sp('Last visited %LASTVISIT%'));

 

Sorry, I should have included that in my reply. Just make sure you paste your Google Adsense code BEFORE the closing quote. Anything in the quotes can be standard HTML ... like the Google Adsense code.

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Jan 29, 2012 - 1:49 pm

yup. the theme is really just php code which generates html... so including it directly in the theme is perfectly fine and simple...

of course, that does require you to make the theme your own and potentially miss some updates, but no different than a wp theme...

Avatar
rocklandusa
Member
Free Members
sp_UserOfflineSmall Offline
Jan 29, 2012 - 1:51 pm

Mr Papa said

yup. the theme is really just php code which generates html... so including it directly in the theme is perfectly fine and simple...

of course, that does require you to make the theme your own and potentially miss some updates, but no different than a wp theme...

Yeah, if there are any updates to the theme I have to remind myself to go add this code in later. Hopefully when more documentation comes out using Functions, etc I can do something more direct. 

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Jan 29, 2012 - 2:10 pm

understand. lots of actions and filters for you to use, but you are right documentation is just beginning to be populated on our code at http://codex.simple-press.com

could always use a hand populating it! wink

Avatar
rocklandusa
Member
Free Members
sp_UserOfflineSmall Offline
Jan 29, 2012 - 7:19 pm

Mr Papa said

understand. lots of actions and filters for you to use, but you are right documentation is just beginning to be populated on our code at http://codex.simple-press.com

could always use a hand populating it! wink

I would help if I knew more of what I was doing. Not a php programmer at all. I do lots of trial and error. Sorry.

Forum Timezone: Europe/Stockholm
Most Users Ever Online: 1170
Currently Online:
Guest(s) 1
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Mr Papa: 19448
Ike: 2086
Brandon: 864
kvr28: 804
jim: 650
FidoSysop: 577
Conrad_Farlow: 531
fiddlerman: 358
Stefano Prete: 325
Member Stats:
Guest Posters: 619
Members: 17362
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10127
Posts: 79625