Here we want to read your Ideas and Wishes to Garys Cookbook 3.X.x Of course also to everything around the Cookbook as the extensions. We need your Ideas to improve this component in a from you desired direction. The Ideas from the old thread are moved to this new Subforum. In this subforum it is easier to discuss and comment the ideas. Please open a new thread for each idea.Questions to the actual versions of course are written in the normal Forum as usual.

Alphauserpoints plugin

  • yo5ofh
  • Topic Author
  • Visitor
  • Visitor
15 years 3 months ago #3043 by yo5ofh
Alphauserpoints plugin was created by yo5ofh
Hello,

Anybody can help me to create a plugin for Alphauserpints? I want to offer any point to my users after each uploaded recipes.

Other: where can I view in the recipe manager who posted that recipe?

Thanks,
Csaba

Please Log in to join the conversation.

  • six gun
  • Visitor
  • Visitor
15 years 2 months ago #3179 by six gun
Replied by six gun on topic Re:Alphauserpoints plugin
I had never heard of this before reading it here.
I can only assume you have - but have you read

http://www.alphaplug.com/index.php/alphauserpoints.html?start=2

Please Log in to join the conversation.

More
15 years 2 months ago #3181 by over
Replied by over on topic Aw: Re:Alphauserpoints plugin
Hi six gun,

Thanks for the link-tip.
I think better to start with
http://www.alphaplug.com/index.php/alphauserpoints.html

If someone wants to use it for a single installation with the Cookbook you're welcome to inform all users how to do it.

I hope you understand that to include it into the component-distribution there has to be a LOT more work to be done.

over

Please Log in to join the conversation.

  • ksnieder
  • Visitor
  • Visitor
15 years 2 months ago #3182 by ksnieder
Replied by ksnieder on topic Re:Aw: Re:Alphauserpoints plugin
I'm not a coder by nature but I can often piece together things. I have created the necessary .xml file and am trying to figure out how to alter the Gary's Cookbook edit.php file... where does the code insert the new submission into the database... that is generally where you will insert the following code:

$api_AUP = JPATH_SITE.DS.'components'.DS.'com_alphauserpoints'.DS.'helper.php';
if ( file_exists($api_AUP))
{
require_once ($api_AUP);
AlphaUserPointsHelper::newpoints( 'plgaup_addrecipe_garyscookbook' );
}

And here's what you put in the .xml file:
<?xml version="1.0" encoding="UTF-8"?>
<alphauserpoints type="plugin">
<rule>Add a recipe</rule>
<description>Add points when a User adds a recipe</description>
<component>com_garyscookbook</component>
<plugin_function>plgaup_addrecipe_garyscookbook</plugin_function>
<fixed_points>true</fixed_points>
</alphauserpoints>

So back to my question... where in edit.php is the new submission inserted into the database?

Please Log in to join the conversation.

More
15 years 2 months ago #3184 by over
Replied by over on topic Aw: Re:Aw: Re:Alphauserpoints plugin
Why not try the savePost function in the same file?

But again! programming it for a single installation is NOT the same as making it work in a component!!!

over

Please Log in to join the conversation.

  • ksnieder
  • Visitor
  • Visitor
15 years 2 months ago #3185 by ksnieder
Replied by ksnieder on topic Re:Alphauserpoints plugin
Exactly what I was looking for...

Find the following code at or around line 488:
Code:
if (!$newcookbook->store()) { echo "<script> alert('" . $row->getError() . "'); window.history.go(-1); </script>\n"; exit(); }

Insert the following immediately after:
Code:
$api_AUP = JPATH_SITE.DS.'components'.DS.'com_alphauserpoints'.DS.'helper.php'; if ( file_exists($api_AUP)) { require_once ($api_AUP); AlphaUserPointsHelper::newpoints( 'plgaup_addrecipe_garyscookbook' ); }

And don't forget to upload the .xml file above to alpha user points rules section....

Worked like a charm:)

Please Log in to join the conversation.

Time to create page: 0.159 seconds