Support Forum

Need help after upgrading to v5

IN Ingo
Ingo
Member

1. Before today, I used simple press 4.3 but one day I could not access most parts of the admin section anymore. I could access the main pages (e.g. options) but not the sub pages that are displayed on the left side (nothing happened when I clicked on one of them).

Any idea why this was?

 

2. After installing version 5 my blog did not load. It hang when calling <?php sf_recent_posts_tag(5, true, true, true, true, 0, true); ?> when loading the side bar (I put this in to display a list of the latest 5 forum posts in the sidebar of my blog). (–> Fatal error, call to undefined function…)

I put out this line for now but I want to display that list, what to do?

 

3. I put in adsense code somewhere (long time ago). As it is gone now, can you point me in the right direction how that was done (do I have to use those hooks?)

4. Can I restore my old skin into v5? Can I copy it in?

5. Each page and post in my blog have some buttons at the bottom (e.g. for facebook like and follow on twitter). These are now in each forum post, too, this was not the case before. What to do to get rid of it?

thanks for any help

14 Answers

New Answer

YS Yellow Swordfish
Yellow Swordfish
Member

Ingo Raven said
1. Before today, I used simple press 4.3 but one day I could not access most parts of the admin section anymore. I could access the main pages (e.g. options) but not the sub pages that are displayed on the left side (nothing happened when I clicked on one of them).

Any idea why this was?

There could be several reasons. If you upgraded your WP version but did not match the correct SP version with it then it could be that simple. Other plugins have also been known to cause conflicts if they load their scripts globally. We can usually discover the reason for that sort of behaviour.

2. After installing version 5 my blog did not load. It hang when calling <?php sf_recent_posts_tag(5, true, true, true, true, 0, true); ?> when loading the side bar (I put this in to display a list of the latest 5 forum posts in the sidebar of my blog). (–> Fatal error, call to undefined function…)

I put out this line for now but I want to display that list, what to do?

V5 is a complete and total rewrite. The tag still exists but it has a different name now and different calling methods. You will need to install the SP ‘Template Tags’ plugin. If your WP theme is set up for widgets then I would recommend using the one supplied in that SP plugin. (http://codex.simple-press.com/codex/api/functions-and-tags/widgets/)

3. I put in adsense code somewhere (long time ago). As it is gone now, can you point me in the right direction how that was done (do I have to use those hooks?)

The old hooks are also gone but there is much, much more flexibility to enable things like this. Where did you want it to display? We can point you in the right direction.

4. Can I restore my old skin into v5? Can I copy it in?

No – as was stated on the V5 upgrade notes, Skins and Icon Sets are no longer supported in favour of themes and templates. Again – much more flexible. Take a look through the colour overlays as we have tried to match wherever possible V4 skin styles. (http://codex.simple-press.com/codex/themes/theme-basics/sample-theme-overlays/)

5. Each page and post in my blog have some buttons at the bottom (e.g. for facebook like and follow on twitter). These are now in each forum post, too, this was not the case before. What to do to get rid of it?

thanks for any help

Every forum post? Not a good sign that it is well-written. is it possible to exclude it from the forum page?

IN Ingo
Ingo
Member

Thanks for your response. See my reply to your suggestions below.


Yellow Swordfish said

Ingo Raven said

>>
2. After installing version 5 my blog did not load. It hang when calling <?php sf_recent_posts_tag(5, true, true, true, true, 0, true); ?> when loading the side bar (I put this in to display a list of the latest 5 forum posts in the sidebar of my blog). (–> Fatal error, call to undefined function…)

I put out this line for now but I want to display that list, what to do?

V5 is a complete and total rewrite. The tag still exists but it has a different name now and different calling methods. You will need to install the SP ‘Template Tags’ plugin. If your WP theme is set up for widgets then I would recommend using the one supplied in that SP plugin. (http://codex.simple-press.com/codex/api/functions-and-tags/widgets/)

<<

Widgets mess up my sidebar so I’d like to install it manually.

>>

3. I put in adsense code somewhere (long time ago). As it is gone now, can you point me in the right direction how that was done (do I have to use those hooks?)

The old hooks are also gone but there is much, much more flexibility to enable things like this. Where did you want it to display? We can point you in the right direction.

<<

I had one Adsense block below the first post in a thread and another below the last post.

>>

5. Each page and post in my blog have some buttons at the bottom (e.g. for facebook like and follow on twitter). These are now in each forum post, too, this was not the case before. What to do to get rid of it?

thanks for any help

Every forum post? Not a good sign that it is well-written. is it possible to exclude it from the forum page?
<<

OK, I could disable the “Buy me a beer” for the forum page and that did the trick that this one is not displayed below each forum post. However, when I enable the facebook/twitter buttons for pages (which I need) it is displayed below each forum post, I did not find a way to exclude this one for the forum page.

MP Mr Papa
Mr Papa
Member

due to improper quoting, not sure exactly what you are trying to say…

but if you want to use a tag or shortcode instead of the widget, use:

function sp_RecentPostsTag($args=”);

or

function sp_RecentPostsShortcode($atts)

we are working to populate the codex with the complete api, but until then take a look at the code for the possible arguments – they mirror the widget…  or just use the default…

how are the buttons added?  shortcode? other?

IN Ingo
Ingo
Member

how are the buttons added?  shortcode? other?

In the setting of the plugin (TF Social Share) I can individually enable/disable the buttons for post, pages,homepage, archives, tags, etc. When pages is enabled (which I need) it is added into each forum post.

YS Yellow Swordfish
Yellow Swordfish
Member

We will really need to know what mechanism that plugin uses to decide when and where to display itself. Even then it might be a case of negotiating with the plugin author although there may be a workaround.
Give me a link to the plugin and I could download and install it to see if I can work it out. I may not be able to do this today however.

IN Ingo
Ingo
Member

I worked around it by disabling the automatic display of the buttons and placed them manually now, so this solution works for me. I noticed the same behaviour with several plug-ins:

Twitter facebook social share: http://www.searchtechword.com/2011/06/wordpress-plugin-add-twitter-facebook-google-plus-one-share/

buy me a beer: (no working plugin url anymore)

and another one I was messing around, don’t remember which it was, possibly all that automatically display something on pages.

 

I got the other points sorted out by now, just the adsense is still not clear to me. I would like to have an add below the first and the last post of a thread.

YS Yellow Swordfish
Yellow Swordfish
Member

OK let’s talk AdSense code!
Do you know how to use WordPress action/filter hooks? As this would be the ‘cleanest’ way to do this.

IN Ingo
Ingo
Member

No, never used these but I can edit any file when I know where to put the code in.

MP Mr Papa
Mr Papa
Member

I think the easist way then is to just add to your sp theme… you have made your own sp theme? (http://codex.simple-press.com/codex/themes/theme-basics/creating-a-theme/)

so go to your sp theme and the template directory… edit the file spTopicView.php…  find this line of code:

                    sp_SectionEnd(”, ‘post’);

after it, do something like:

if ($spThisPost->first_post_on_page || $spThisPost->last_post_on_page) {
    # my adsense code here
}

and then put your adsense code where indicated…  note, depending on the format of your adsense code (ie js?), you may need to put closing and opening php tags (ie ?> and <?php) around it and add some styling…

IN Ingo
Ingo
Member

Thanks. I put it in a few lines before, after

sp_PostIndexUserSignature(‘tagClass=spPostUserSignature spCenter&maxHeightBottom=55’);
                            sp_InsertBreak();

 

then it is directly at the bottom of the post (instead of between two posts), like it was before.

MP Mr Papa
Mr Papa
Member

ah, so you want it in the first post and the last post…  bit different, but glad you figured it out! wink

MA MartiL
MartiL
Member

Mr Papa said

so go to your sp theme and the template directory… edit the file spTopicView.php…  find this line of code:

                    sp_SectionEnd(”, ‘post’);

after it, do something like:

if ($spThisPost->first_post_on_page || $spThisPost->last_post_on_page) {
    # my adsense code here
}

I’m starting to think I’m just to dumb to use SP cry

I’ve tried all the examples given in all the adsense topics, including this one (with and without php tags) and all I get is a fatal error … confused

YS Yellow Swordfish
Yellow Swordfish
Member

Paste us your code and we can take a look. Most errors with this come down to mismatched quotes. If you can use the code button on the toolbar here to format it it will be better.

paste us the actual fatal error message as well.

BR Brandon
Brandon
Member

MartiL said

I’m starting to think I’m just to dumb to use SP cry

I’ve tried all the examples given in all the adsense topics, including this one (with and without php tags) and all I get is a fatal error … confused

 

Your adsense code probably looks something like this:

<script type="text/javascript"><!--
google_ad_client = "ca-pub-363700071xxxxxxx";
/* 468 */
google_ad_slot = "7759544xxxx";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.go

What you would do is echo it out like this.

echo '<script type="text/javascript"><!--
google_ad_client = "ca-pub-363700071xxxxxx";
/* 468 */
google_ad_slot = "7759544xxxx";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>';

 

Make sure you use the ‘ single quote at the beginning and end and finish with the semicolon.

You could also create a function in your theme’s spFunction.php file like this.

function spAdsense468() {
 echo '<center><script type="text/javascript"><!--
 google_ad_client = "ca-pub-3637000718xxxxx";
 /* 468 */
 google_ad_slot = "7759544xxxx";
 google_ad_width = 468;
 google_ad_height = 60;
 //-->
 </script>
 <script type="text/javascript"
 src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
 </script></center>';
 }

 

Then wherever you want to place your 468×60 ad use

spAdsense468();

You can create several adsense functions for any size ad and include in your spFunctions file to make it easier too.

Create one called spAdsense728() for 728×90 sizes or spAdsenseText() for text ads, etc. Then just put the function that uses the ad you want to show into wherever you want it.