Topic-icon object type in custom component

Active Subscriptions:

None
11 years 1 month ago #31524 by moparlakci
Hello,

I want to change the fb meta tag in my own component to post open graph actions

it is always set as an 'article' in the source

it has to be 'table'

I can change this by javascript but it has to be done in php I suppose :)

can anyone help me with this issue?

thanks
The topic has been locked.
Support Specialist
11 years 1 month ago #31528 by alzander
Yes, it would have to be done in PHP as Facebook's crawler doesn't execute Javascript and wouldn't see those modifications.

What you should do is:
* Install the Open Graph - Custom plugin
* Enable it in the Plugin manager
* Go to the Open Graph -> Objects area of JFBConnect
* Click "New", then click "Custom Object Type"
* Set the name to whatever you want
* Set the Object Type to whatever you want it to be
* Then, in the right for URL Query Parameters, simply put something like:

option=com_yourcomponent
view=blahblah

You can just set the option, or you can be as specific as you want by adding more parameters for each line.

Hope that helps get you going, but if you have more questions, just let us know.

Thanks,
Alex
The topic has been locked.
Active Subscriptions:

None
11 years 1 month ago #31529 by moparlakci
Okay My Read actions are being published on facebook but my other action 'reserve' is not being published because I want this to be published when a custom component is accessed and a button is clicked. I have set up a new custom object

with url query parameters like this

option=com_mycomponent
view=reservation
layout=complete


and open graph tags like this

type=randomrandom:table


in the activity log

(#3502) Object at URL *****?view=reservation&layout=complete has og:type of 'place'. The property 'table' requires an object of og:type 'randomrandom:table'. (http response code: 206)
The topic has been locked.
Support Specialist
11 years 1 month ago #31579 by alzander
Use the Facebook URL Debug Tool to check the page that isn't posting properly and see what data Facebook sees. It should tell you if there are multiple 'type' properties defined or if there is only one, and it's defined as 'place' instead of 'table', which you want.

From that, we should know how to proceed a little better. You may also want to disable any other 'objects' you have defined in JFBConnect to make sure they aren't accidentally being used for the page you want.

Let us know how that goes,
Alex
The topic has been locked.
Active Subscriptions:

None
11 years 1 month ago #31820 by moparlakci
Hi thanks

I have changed some strategies :)

I have created an article 'A table' and put some text in it

Created a custom object in backend with these options
option=com_content
view=article
id=12

and opengraph
myown:table

And in my own component I have added a button with the javascript code - which I found in other threads - with the url pointing to this article.
got the ID of my action and the code looks like this
a class="btn btn-large" href="javascript:void(0)" onclick="jfbc.opengraph.triggerAction('1','http://www.example.com/table/');">
Click here to post the action to FB!
/a


for those who have problems with this code, you haven't probably enabled mootools, just put this above your code/template
JHtml::_('behavior.keepalive');



now when someone clicks on this button, it fires an action to Fb, thats great!

My question is How can I show this button to only Facebook users? is there a method or variable?

i can check a user if he is guest or not like this
if ($this->user->get('guest')):
	// The user is not logged in.

else:
	// The user is already logged in.
	
endif;

Im using joomla 3.0 and I have set Error Reporting to 'Development', so I see every little warning, and it gives me this warning
Strict Standards: Declaration of JFBConnectControllerOpenGraph::display() should be compatible with JControllerLegacy::display($cachable = false, $urlparams = Array) in /home/restoWeb/www/components/com_jfbconnect/controllers/opengraph.php on line 13

Okay I can hide this one, thats no problem :)


thanks alot
The topic has been locked.
Support Specialist
11 years 1 month ago #31830 by alzander
Glad to hear you're making progress and getting your Custom Actions going.

To check if the user is logged in through Facebook, you can use the following code:
$jfbcLibrary = JFBConnectFacebookLibrary::getInstance();
if ($jfbcLibrary->userIsConnected() )
{
  // Do something here
}
We're always looking for strict errors we have missed. We'll look into fixing that one in the next release, but it's something that can be safely hidden.

Hope that helps,
Alex
The topic has been locked.
Active Subscriptions:

None
11 years 3 weeks ago #31998 by moparlakci
everything works fine now, but what does the error 'action not ready for this user' mean?

and how can I delete this css file
/components/com_jfbconnect/assets/jfbconnect.css

where is it being imported in the dom?
I couldn't find it
The topic has been locked.
Support Specialist
11 years 3 weeks ago #32005 by alzander
The "Action not ready for this user" means that the action is being triggered too frequently. So, if you've configured the action to only occur once every day, for instance, and the user has already triggered that action, if the user tries to trigger the same action later that day, they'd see that message. Hope that explains, but if you need more information, let me know.

As for the jfbconnect.css file, that's only included in the /components/com_jfbconnect/views/opengraph/view.html.php file. It should only be included on our pages listing the user's actions in JFBConnect.

Best of luck,
Alex
The topic has been locked.
Active Subscriptions:

None
11 years 3 weeks ago #32044 by moparlakci
okay i've found it it's being imported via the plugin

system/jfbcsystem/jfbcsystem.php

on line 449

I am using less css to generate my css files, thats why I needed to remove it

thanks
The topic has been locked.
Support Specialist
11 years 3 weeks ago #32049 by alzander
I'll have to look, I didn't realize it was in that file as well. Glad you got it going though. Should you need anything else, just let us know.

Thanks!
Alex
The topic has been locked.