Notice

The forum is in read only mode.

Support Forum

Welcome! Support Forums have been reactivated
Welcome the Technical Support section. Help us in assisting you by providing us with a concise and descriptive elaboration of your issues. Be specific and if possible, provide us with a step-by-step instruction in replicating your problem.

How do I change plugin title on user profile?

12 years 3 months ago
  • Enrico's Avatar
    Topic Author
  • Enrico
  • Offline
  • Fresh Boarder
  • Posts: 9
  • Thank you received: 1
Licenses:
JomSocial Expired

I'd like to gather some basics on how to make community plugins. I'm an experienced PHP developer, but after following JomSocial's documentation for creating community plugins , I was lost.

This is my first time creating a plugin for Joomla!, and I'm running Joomla! 3.3.1 and JomSocial 3.2.0.6. If you refer to the attached screenshot, I was able to make a slightly-modified version of the "example" plugin from the documentation, but you'll notice in the red-boxed area, my plugin's title is "PLG_SPONSORS_TITLE".

My sponsors.xml has:

<languages>
	<language tag="en-GB">en-GB.plg_community_sponsors.ini</language>
	<language tag="en-GB">en-GB.plg_community_sponsors.sys.ini</language>
</languages>

plg_community_sponsors.ini has:
PLG_SPONSORS_TITLE="This needs a title"

My general questions I hope to seek help for are:
  1. How do I change the plugin title?
  2. What hook should I use to gather user data?
  3. Are there built-in classes available for database/MySQL access?
  4. Can I remove the toggle button on the top-right of the module?

Your guidance is much appreciated!

Attachments:
12 years 3 months ago
Licenses:

Hi, Enrico.

I assign developer to this thread.


- Instead of saying: 'it's not working', explain the problem in detail.
- Screenshots with the URL visible in them and the problem marked are more than welcome.
- Tell us how to replicate the problem, we can't fix it if we can't find it.
- Make sure that your site/server meets JomSocial System Requirements
- Make sure to setup JomSocial Cron Job
- Always provide us with access details to the backend and ftp. We need it to debug problems.
- If you have a similar problem, but a solution you found isn't working, open a new thread instead of 'merging' with an existing one.

- Use the "Thank You" feature on any post that helped you
12 years 3 months ago
  • Dimas Tekad Santosa's Avatar
  • Dimas Tekad Santosa
  • Visitor
  • Thank you received: 0
Licenses:

Hi Enrico,

Can you try to put file en-GB.plg_community_sponsors.ini and en-GB.plg_community_sponsors.sys.ini to administrator language folder, please? because we check the lang file from the administrator folder.

If this method still now working, I need your FTP access to inspect this issue further.

thank you

12 years 3 months ago
  • Enrico's Avatar
    Topic Author
  • Enrico
  • Offline
  • Fresh Boarder
  • Posts: 9
  • Thank you received: 1
Licenses:
JomSocial Expired

Thanks for your reply Dimas,

I have updated my post details for FTP access. I tried uploading my languages files in the administrator folder, but the issue still persists. You'll see that my plugin was uploaded to plugins/community/sponsors. Please have a look.

12 years 3 months ago
  • Dimas Tekad Santosa's Avatar
  • Dimas Tekad Santosa
  • Visitor
  • Thank you received: 0
Licenses:

Hi Enrico,

Thank you for the FTP access, but you didnt provide me the backend access, can you also provide it please?

thank you

12 years 3 months ago
  • Enrico's Avatar
    Topic Author
  • Enrico
  • Offline
  • Fresh Boarder
  • Posts: 9
  • Thank you received: 1
Licenses:
JomSocial Expired

Hi Enrico,

Can you try to put file en-GB.plg_community_sponsors.ini and en-GB.plg_community_sponsors.sys.ini to administrator language folder, please? because we check the lang file from the administrator folder.

If this method still now working, I need your FTP access to inspect this issue further.

thank you

Dimas Tekad Santosa wrote: Hi Enrico,

Thank you for the FTP access, but you didnt provide me the backend access, can you also provide it please?

thank you


I've updated my original post to include backend access. It would have been available had I known from your previous post. Your prompt support would be appreciated.

12 years 3 months ago
  • Dimas Tekad Santosa's Avatar
  • Dimas Tekad Santosa
  • Visitor
  • Thank you received: 0
Licenses:

Hi Enrico,

Can you check again, please? should work fine now.. I added this code :

CAppPlugins::loadLanguage( 'plg_community_' . $plgObjWrapper->getPluginName() , JPATH_ADMINISTRATOR );

inside this file components/com_community/libraries/apps.php (211)

thank you

12 years 3 months ago
  • Enrico's Avatar
    Topic Author
  • Enrico
  • Offline
  • Fresh Boarder
  • Posts: 9
  • Thank you received: 1
Licenses:
JomSocial Expired

That's a very obscure solution, but it worked. Thank you.

When I edit my sponsors.php page, I'd like to be able to use more names from my language file such as PLG_SPONSORS_NEW ("Add a Sponsor!"). Using these defined names doesn't work. In my file, I have:

sponsors.php From line 122

//create a slot for an extra sponsor and if user is logged in
$usr = JFactory::getUser();
$usrID = $usr->id;
//print("Logged in: ".$usrID." Profile: " . $id);
if ($c < 5 && $usrID === $id) {
	$sponsors .= '
	<div class="newSponsor">
	<a title="'.PLG_SPONSORS_NEW.'" href="javascript:cWindowShow(\'Hello World\', \'Create Referral URL\')">
		+
	</a>
	</div>
	';
}
$content = str_replace('@replace', $sponsors, $content);
return $content;
In this sample, "PLG_SPONSORS_NEW" does not point to its defined string as per my en-GB.plg_community_sponsors.ini file. How do I use my named variables within sponsors.php, or any other helper php file?

12 years 3 months ago
  • Dimas Tekad Santosa's Avatar
  • Dimas Tekad Santosa
  • Visitor
  • Thank you received: 0
Licenses:

Hi Enrico,

You need to use this code :

JText::_('PLG_SPONSORS_NEW')

I hope it will work

12 years 3 months ago
  • Enrico's Avatar
    Topic Author
  • Enrico
  • Offline
  • Fresh Boarder
  • Posts: 9
  • Thank you received: 1
Licenses:
JomSocial Expired

Thank you for your help. I think it would be beneficial to others to update the documentation to include all these tips and code modifications.

Moderators: Piotr Garasiński
Powered by Kunena Forum

Join 180,000 websites creating Amazing communities

JomSocial is the most complete, easy-to-use addon that turns Joomla CMS into a
full -fledged, social networking site

TRY NOW BUY NOW