Montego Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic
Author Message
hicux
Newbie
Newbie



Joined: Jan 30, 2009
Posts: 92
Location: NL

PostPosted: Tue Oct 08, 2013 7:00 pm Reply with quote

Hi Montego.

I tried to "add this" system on my website and works pretty good but the Recommended blocks are not working. I already activated on the website but it doesn't show. This is my example, maybe I am missing something.

Shocked

Code:
<?php

$bodyHTML = '
<!-- AddThis Smart Layers BEGIN -->
<!-- Go to http://www.addthis.com/get/smart-layers to customize -->
<script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=mycode"></script>
<script type="text/javascript">
  addthis.layers({
    \'theme\' : \'transparent\',
    \'share\' : {
      \'position\' : \'left\',
      \'numPreferredServices\' : 4
    },
    \'follow\' : {
      \'services\' : [
        {\'service\': \'facebook\', \'id\': \'pages/name/2222222222222\'},
        {\'service\': \'twitter\', \'id\': \'_username\'},
        {\'service\': \'google_follow\', \'id\': \'000000000000000\'}
      ]
    },   
    \'whatsnext\' : {},
    \'recommended\' : {
    \'title\': \'Recommended for you:\'
    }
  });
</script>
<!-- AddThis Smart Layers END -->
';

if (is_array($bodyJS) and function_exists('addJSToBody')) addJSToBody($bodyHTML, 'inline');
else echo $bodyHTML."\n";
 
View user's profile Send private message Visit poster's website
montego
Site Admin/Owner
Site Admin/Owner



Joined: Feb 12, 2005
Posts: 1399

PostPosted: Wed Oct 09, 2013 7:25 am Reply with quote

Where have you put this code?

_________________
“To err is human, but when the eraser wears out ahead of the pencil, you’re overdoing it.”
-- Josh Jenkins 
View user's profile Send private message Visit poster's website
hicux
Newbie
Newbie



Joined: Jan 30, 2009
Posts: 92
Location: NL

PostPosted: Wed Oct 09, 2013 7:59 am Reply with quote

Here like this
Wink

includes/addons/body-AddThis.php

Maybe my function footer is not good. Did u see any mistake?

Code:
function themefooter() {
    global $index, $banners, $foot1, $foot2, $foot3, $foot4, $name, $copyright, $totaltime, $footer_message;
    if ($index == 1) {
   $tmpl_file = 'themes/Dolphins/center_right.html';
   $thefile = implode('', file($tmpl_file));
   $thefile = addslashes($thefile);
   $thefile = '$r_file="'."$thefile".'";';
   eval($thefile);
   print $r_file;

   blocks('right');

    }

    $tmpl_file = 'themes/Dolphins/footer.html';
    $thefile = implode('', file($tmpl_file));
    $thefile = addslashes($thefile);
    $thefile = '$r_file="'."$thefile".'";';
    eval($thefile);
    print $r_file;


    echo '<div class="text-center">'."\n";
    echo '<div class="small">';
    $footer_message = footmsg();
    echo '<br /><h3><a href="http://www.bestbuildpc.org" title="Visit Us" target="_self" id="Visit">BestBuildPC</a></h3><br />';
    echo '</div></div>'."\n";
}
 
View user's profile Send private message Visit poster's website
montego
Site Admin/Owner
Site Admin/Owner



Joined: Feb 12, 2005
Posts: 1399

PostPosted: Wed Oct 09, 2013 8:44 am Reply with quote

Oh, wait a minute, I think I now understand what you meant by "Recommended blocks". Sorry...

If the rest of the tools seem to be working, I thought that I remembered reading somewhere that some of the features will take some time to start showing up as the layers tool starts to "see" the content. It could take a few days?

_________________
“To err is human, but when the eraser wears out ahead of the pencil, you’re overdoing it.”
-- Josh Jenkins 
View user's profile Send private message Visit poster's website
hicux
Newbie
Newbie



Joined: Jan 30, 2009
Posts: 92
Location: NL

PostPosted: Wed Oct 09, 2013 8:48 am Reply with quote

No just 24 hours but it is taking so many days already. I think last week I did it so that is why I am asking u.

Shocked
 
View user's profile Send private message Visit poster's website
montego
Site Admin/Owner
Site Admin/Owner



Joined: Feb 12, 2005
Posts: 1399

PostPosted: Wed Oct 09, 2013 8:52 am Reply with quote

Well, footer has nothing to do with it and your addon code looks fine to me, but it is not how I did it. What I would do is compare the generated HTML/JS on your site to the code given by AddThis. As long as they are matching, I don't know what to tell you... its all "magic" on their end. Nothing else is needed on your end.

I do remember using AddThis to bookmark a few links early on... just thinking that might help "seed" the data, but have no idea if that was even necessary. Doubtful.

_________________
“To err is human, but when the eraser wears out ahead of the pencil, you’re overdoing it.”
-- Josh Jenkins 
View user's profile Send private message Visit poster's website
montego
Site Admin/Owner
Site Admin/Owner



Joined: Feb 12, 2005
Posts: 1399

PostPosted: Wed Oct 09, 2013 8:58 am Reply with quote

Never mind! Sorry... just realized on my own site that AddThis is generating the HTML elements... you can't compare.

As far as I can tell everything looks fine. The only different between yours and mine is that I embedded the code in includes/custom_files/custom_head.php.

Old *nuke habits die hard... Laughing

_________________
“To err is human, but when the eraser wears out ahead of the pencil, you’re overdoing it.”
-- Josh Jenkins 
View user's profile Send private message Visit poster's website
hicux
Newbie
Newbie



Joined: Jan 30, 2009
Posts: 92
Location: NL

PostPosted: Wed Oct 09, 2013 9:29 am Reply with quote

I tried with another clean theme but no clue what is going on.
 
View user's profile Send private message Visit poster's website
montego
Site Admin/Owner
Site Admin/Owner



Joined: Feb 12, 2005
Posts: 1399

PostPosted: Fri Oct 11, 2013 5:36 pm Reply with quote

Just curious... have you tried a theme that does not use eval()?

_________________
“To err is human, but when the eraser wears out ahead of the pencil, you’re overdoing it.”
-- Josh Jenkins 
View user's profile Send private message Visit poster's website
hicux
Newbie
Newbie



Joined: Jan 30, 2009
Posts: 92
Location: NL

PostPosted: Sat Oct 12, 2013 8:00 pm Reply with quote

yes! Like alteredDark which I think it is good.
 
View user's profile Send private message Visit poster's website
montego
Site Admin/Owner
Site Admin/Owner



Joined: Feb 12, 2005
Posts: 1399

PostPosted: Sun Oct 13, 2013 10:18 am Reply with quote

Two questions:

1) Just so I am clear with what you said, you are telling me that the AlteredDark theme, when used, is showing all the proper AddThis "Recommended for you" blocks?

2) I'd like to see the site where you have this loaded (using a theme that does NOT work). Maybe PM me the URL if you do not wish to make it public.

_________________
“To err is human, but when the eraser wears out ahead of the pencil, you’re overdoing it.”
-- Josh Jenkins 
View user's profile Send private message Visit poster's website
hicux
Newbie
Newbie



Joined: Jan 30, 2009
Posts: 92
Location: NL

PostPosted: Tue Oct 15, 2013 7:51 pm Reply with quote

Quote:
1) Just so I am clear with what you said, you are telling me that the AlteredDark theme, when used, is showing all the proper AddThis "Recommended for you" blocks?


No it doesn't work neither. I just installed alterDark theme and I can make a picture if u want so u see it doesn't show.
Sad

I am running AlterDark now. Let me know when u see it so I can switch it again.

http://www.bestbuildpc.org/
 
View user's profile Send private message Visit poster's website
montego
Site Admin/Owner
Site Admin/Owner



Joined: Feb 12, 2005
Posts: 1399

PostPosted: Wed Oct 16, 2013 8:47 am Reply with quote

I think I may have found your issue. Compare this line you have with the one on my site:

Code:

<script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=mycode"></script>


I think your pubid isn't right.

_________________
“To err is human, but when the eraser wears out ahead of the pencil, you’re overdoing it.”
-- Josh Jenkins 
View user's profile Send private message Visit poster's website
hicux
Newbie
Newbie



Joined: Jan 30, 2009
Posts: 92
Location: NL

PostPosted: Thu Oct 17, 2013 8:47 am Reply with quote

This is what I have montego

Code:
<?php

$bodyHTML = '
<!-- AddThis Smart Layers BEGIN -->
<!-- Go to http://www.addthis.com/get/smart-layers to customize -->
<script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=bestbuildpc"></script>
<script type="text/javascript">
  addthis.layers({
    \'theme\' : \'transparent\',
    \'share\' : {
      \'position\' : \'left\',
      \'numPreferredServices\' : 4
    },
    \'follow\' : {
      \'services\' : [
        {\'service\': \'facebook\', \'id\': \'pages/bestbuildpc.ict/337437973003389\'},
        {\'service\': \'twitter\', \'id\': \'_bestbuildpc\'},
        {\'service\': \'google_follow\', \'id\': \'101317679175525430601\'}
      ]
    },   
    \'whatsnext\' : {},
    \'recommended\' : {
    \'title\': \'Recommended for you:\'
    }
  });
</script>
<!-- AddThis Smart Layers END -->
';

if (is_array($bodyJS) and function_exists('addJSToBody')) addCSSToHead($bodyHTML, 'inline');
else echo $bodyHTML."\n";


Last edited by hicux on Thu Oct 17, 2013 9:35 am; edited 1 time in total 
View user's profile Send private message Visit poster's website
montego
Site Admin/Owner
Site Admin/Owner



Joined: Feb 12, 2005
Posts: 1399

PostPosted: Thu Oct 17, 2013 9:14 am Reply with quote

That isn't what I was seeing in the generated HTML on your site when I wrote my original message.

I do see that you have changed it now.

There is nothing else wrong that I can see. I do not believe this to be a CMS issue unless there is something conflicting with the JS. You may need to follow up with AddThis to get their help.

_________________
“To err is human, but when the eraser wears out ahead of the pencil, you’re overdoing it.”
-- Josh Jenkins 
View user's profile Send private message Visit poster's website
Display posts from previous:       
Post new topic   Reply to topic

View next topic
View previous topic
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-2007 phpBB Group
All times are GMT - 4 Hours
 
Forums ©
linear-bunch
linear-bunch
linear-bunchlinear-bunch