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
  • Autor
  • Besucher
  • Besucher
14 Jahre 10 Monate her #3043 von yo5ofh
Alphauserpoints plugin wurde erstellt von 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

Bitte Anmelden um der Konversation beizutreten.

  • six gun
  • Besucher
  • Besucher
14 Jahre 9 Monate her #3179 von six gun
six gun antwortete auf 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

Bitte Anmelden um der Konversation beizutreten.

Mehr
14 Jahre 9 Monate her #3181 von over
over antwortete auf 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

Bitte Anmelden um der Konversation beizutreten.

  • ksnieder
  • Besucher
  • Besucher
14 Jahre 9 Monate her #3182 von ksnieder
ksnieder antwortete auf 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?

Bitte Anmelden um der Konversation beizutreten.

Mehr
14 Jahre 9 Monate her #3184 von over
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

Bitte Anmelden um der Konversation beizutreten.

  • ksnieder
  • Besucher
  • Besucher
14 Jahre 9 Monate her #3185 von ksnieder
ksnieder antwortete auf 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:)

Bitte Anmelden um der Konversation beizutreten.

Ladezeit der Seite: 0.255 Sekunden