News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Share This Topic

Started by Suki, September 06, 2009, 05:09:23 AM

Previous topic - Next topic

busterone

this is what displays, the correct board ids are present
array(17) {
  • => string(1) "2" [1]=> string(1) "6" [2]=> string(1) "9" [3]=> string(2) "10" [4]=> string(2) "17" [5]=> string(2) "18" [6]=> string(2) "34" [7]=> string(2) "41" [8]=> string(2) "43" [9]=> string(2) "46" [10]=> string(2) "54" [11]=> string(2) "55" [12]=> string(2) "67" [13]=> string(2) "71" [14]=> string(2) "94" [15]=> string(3) "104" [16]=> string(3) "107" }

Suki

mmm, is there any error in the error log?

do you have $board_info  globalized on Display.php?

global $board_info;


That is indeed weird
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

luuuciano

Well, for some unknown reason the file wasnt there...
But it was installed on the default theme (the link call to it was ok anyway)... so, the problem was not that?... mmm
No me agradan los foros que no te dejan borrar TU PROPIO usuario, como por ejemplo smfsimple.com.
E incluso te mandan emails no solicitados, de los cuales, quizá, no puedas escapar porque NO te dejan posibilidad a deshabilitarlos (a menos que NO te tengan en su lista negra).

Suki

Quote from: luuuciano on January 14, 2012, 01:06:49 PM
Well, for some unknown reason the file wasnt there...
But it was installed on the default theme (the link call to it was ok anyway)... so, the problem was not that?... mmm

Is it solved?
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

busterone

#1404
no errors in the log. I am not sure I understand what you mean by   
Quotedo you have $board_info  globalized on Display.php?

global $board_info;
I am not much of a coder myself. I understand a small amount, but mainly just enough to edit files where needed. 
I must need some more coffee  :)
Yes, this is from Display.php
// Callback for the message display.
function prepareDisplayContext($reset = false)
{
global $settings, $txt, $modSettings, $scripturl, $options, $user_info, $smcFunc;
global $memberContext, $context, $messages_request, $topic, $attachments, $topicinfo;
global $board_info;

Suki

Well, I'm sure you do have $board_info, otherwise an undefined error  will appear on your error log.


I honestly don't have any idea why your forum do that, I tested the new version on 2 local installations and on 2 live sites with different configurations and it all seems to work fine.


@luuuciano  can you reproduce this problem too?
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

busterone

Yes, see my above edit.
Maybe I missed something, was I supposed to insert this into the file as well? If so, in what part of the file?
/* We need an array */
if (!empty($modSettings['share_options_boards']))
$share_options_boards = explode(',', $modSettings['share_options_boards']);

else
$share_options_boards = array();

Suki

nope, that code is supposedly already on your Display.php file, but if you want attach it here again and I will review it.
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

busterone

OK, I am still thinking I have something a bit off in my forum itself, maybe another mod interfering.

luuuciano

Quote from: Suki on January 14, 2012, 01:17:26 PM
@luuuciano  can you reproduce this problem too?

Will read all the previous posts and try to understand it... eheheh

My problem continues there, firebug shows the same error, on line 493, thats the message content (including the share this code)
For example, here: http://ikers.com.ar/index.php/topic,6289.0.html
No me agradan los foros que no te dejan borrar TU PROPIO usuario, como por ejemplo smfsimple.com.
E incluso te mandan emails no solicitados, de los cuales, quizá, no puedas escapar porque NO te dejan posibilidad a deshabilitarlos (a menos que NO te tengan en su lista negra).

luuuciano

Quote from: Suki on January 14, 2012, 01:17:26 PM
@luuuciano  can you reproduce this problem too?

No, it works ok on my forum... I have setup several boards to not have ShareThis... and the ST code is not there...
No me agradan los foros que no te dejan borrar TU PROPIO usuario, como por ejemplo smfsimple.com.
E incluso te mandan emails no solicitados, de los cuales, quizá, no puedas escapar porque NO te dejan posibilidad a deshabilitarlos (a menos que NO te tengan en su lista negra).

Suki

You have a lot of jquery plugins called at once, one of those may interfere with jquery.hoverIntent.minified.js


Also, you do have a lot of calls to jquery, try to removes some of those calls and leave just one.

You can try to load jquery.hoverIntent.minified directly in your Index.template.php file, since this mod prints the call on a very early stage (just before $context['html_headers'] is defined)  it is very possible that the call to  jquery.hoverIntent.minified is made before jquery is loaded.
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

busterone

I just tried it on a clean install test forum. 2.0.2, no other mods, default theme, and the behavior is the same. I created 3 boards, listed 2 of them for no display of sharethis, and it still displays on those boards and all topics in those boards.   
At this point I am baffled too, since it works as it should for others.
I am sure you have other things to do, so unless it becomes a real issue for a bunch of other forums, I am leaving it as it is.
Thanks for trying.  :)

luuuciano

Quote from: Suki on January 14, 2012, 01:54:25 PM
You have a lot of jquery plugins called at once, one of those may interfere with jquery.hoverIntent.minified.js


Also, you do have a lot of calls to jquery, try to removes some of those calls and leave just one.

You can try to load jquery.hoverIntent.minified directly in your Index.template.php file, since this mod prints the call on a very early stage (just before $context['html_headers'] is defined)  it is very possible that the call to  jquery.hoverIntent.minified is made before jquery is loaded.

Thanks!
I have searched all the jquery calls and erased them, leaving just one... it works now!

Now Im thinking about the hover efect...
It would be usefull when you activate to show the SharIt section on all the posts... I think... (to not annoy showing it everywhere)
But, when someone selects to show ShareIt on 1st post... it would be better to show it always I think....



One question... I have activated the Enable AddThis option, to see it working... but I do not see anything else...
Just see facebook like, twitter & google +1... where should I see the AddThis thing?
Facebook, twitter & +1 are the only sharing things now?
No me agradan los foros que no te dejan borrar TU PROPIO usuario, como por ejemplo smfsimple.com.
E incluso te mandan emails no solicitados, de los cuales, quizá, no puedas escapar porque NO te dejan posibilidad a deshabilitarlos (a menos que NO te tengan en su lista negra).

Suki

What do you mean by "show the SharIt"  what is SharIt ?

The buttons van be show in all messages, you just need to check that option


The AddThis script is showed under the menu, it uses jquery to insert the script after the div with ID #header  if you have a custom theme or youe theme doesn't have that ID then the script will not appear.

The AddScript will share the entire page.
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

busterone

I believe I figured it out. I think that maybe I misunderstood a part of how this works.
I am not using the post buttons whatsoever, just the share button that is right below the main menu on the board index, etc.  I was playing around with the test forum install and noticed that if I enable the post buttons either by show on all posts or first post only, that the board restriction works. The post buttons do not display on any topic in those boards. I was thinking that the board restriction would remove the share button immediately under the main menu on those boards as well, but it doesn't. 
Is that by design? If so, I am at fault for misunderstanding.

Suki

Oh!, well,  the AddThis script is there to share the whole page, so, for example, if it is in a topic, it will share the topic url, for example this topic url:

http://www.simplemachines.org/community/index.php?topic=334955.msg3252689;topicseen#msg3252689

Since the Script takes the url currently showing.

I really didn't think about using the board restriction for the script too, it makes sense to do so now that you mention it.


I was planing to include the AddThis script along with the rest of the buttons (as a replacement for the old icons), the script has some parameters to share multiple urls on a single page, and adding new buttons is now more easy, however, when I added the script, the css part got all mess up.


I'm thinking if adding that script to share a whole page is a good idea or not, relying on a #header ID is probably not a good idea, I just didn't want to do template edits or modify template layers to include the script.


Do you think is worth to have the AddThis script to share a complete page or should I include it on the buttons?
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

busterone

I guess it is good both ways myself, depending on each forum admin's preference really.  I am perfectly ok with it as it is myself, but if you decide to change it to make the board restrictions work for the whole page as well, that would be good too. I have already informed the members that if they share something in a restricted board that the visitor following the link will get directed to a login/register page, so they are all ok with that.
It is your call of course.  :)

Suki

Adding the restriction will not be a problem, however, I'm more worry about the way I use to show the script,  not every theme has a header ID  or some themes have a weird css and the script can appear in a weird place (for example, my site).

I need to find a way to show the script in a good place without doing template edits  and I also need to build an admin interface so admins can select in what actions/pages they want the script to appear/not to appear, of course since there is nothing set to stone regarding actions/pages, this mod in combination with a mod, for example a portal that adds multiple pages, actions or subactions, can result in unsuspected behavior.
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

busterone

True. I use Simpleportal and do have a couple of pages. I also use the custom action mod with several non standard actions added in.  I have 14 member selectable themes installed, and only about a third of them are based on curve.  There are a lot of possible mess ups there.
If you figure it out, great, but like I said, I am ok with it as it is.  The less chances for something to go wrong the better. 

Advertisement: