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.

Custom plugin on photo post - how to tell the post type?

7 years 10 months ago
Licenses:
JomSocial Active iSEO Expired Socialize Expired

ISSUE SUMMARY:
I would like to run a custom database query whenever a user posts a photo. I have set up a custom plugin that runs during the onBeforeStreamCreate event, but the problem is that it runs every time the user post any kind of status update. How do I determine if the status update is a photo upload versus a text update, event, video, etc?

STEPS TO REPLICATE:
1 Post a photo
2 Post a non-photo status update
RESULT Database query runs for both steps
EXPECTED RESULT Database query should only run for step 1
BROWSER Any

7 years 10 months ago
  • Dimas's Avatar
  • Dimas
  • Visitor
  • Thank you received: 0
Licenses:

Hi Megan,

on your plugin you can add the condition, like this

if($params->app=='photos'){
// your code hete
}

I hope it will work

7 years 10 months ago
Licenses:
JomSocial Active iSEO Expired Socialize Expired

Worked perfect, thank you!

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