How to make a alphauserpoints rule linked with flexicontent

More
14 years 8 months ago #16021 by boulij
Hi,
i'm using alphauserpoints and flexicontent.
I would like to have a AUP'rule that give points to a user when he's submiting an article. AUP do it but only with the joomla core submit form.
Is there anyone who know how to modify the AUP rule in order to take in consideration flexicontent? (or made a new one)

Thank you

Please Log in or Create an account to join the conversation.

More
14 years 8 months ago #16034 by micker
maybe in code a plugin ...
but i am not a dev sorry i can't help you :oops:

FLEXIcontent is Free but involves a very big effort on our part.
Like the our support? (for a bug-free FC, despite being huge extension) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing reviews. Thanks![/size]

Please Log in or Create an account to join the conversation.

More
14 years 7 months ago #16172 by boulij
Hi,

Alphauserspoints explain how to create a rule. We have to add the code below under the code which do the action we want to generate points.
But in flexicontent, where is the code (which file and which part of it) which manage the fact to submit a content and add it to the database.
Anyone as a clue?

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

Please Log in or Create an account to join the conversation.

More
14 years 6 months ago - 14 years 6 months ago #16669 by ggppdk
You can try changing the system plugin alphauserpoints.php

Goto to line 152 of file:
/plugins/system/alphauserpoints.php

Replace:
Code:
if ( $option=='com_content' )
with:
Code:
if ( $option=='com_content' || $option=='com_flexicontent' )

UPDATE 8 July 2011: The same code appears twice in this file you can change it twice if you want (second appearance is for saving existent article)

Because other basic post/url variables like task,id,title are the same, it should work.

Note that i dont have alphauserpoints installed to test this. Tell me if it worked.

This change should add points when a new article is submit through flexicontent submit form

UPDATE 8 July 2011: Please see a following post of mine for more modifications.

Regards


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star review. Thanks!
Last edit: 14 years 6 months ago by ggppdk.

Please Log in or Create an account to join the conversation.

More
14 years 6 months ago #16674 by micker
your are a great source of help !!!
thanks

FLEXIcontent is Free but involves a very big effort on our part.
Like the our support? (for a bug-free FC, despite being huge extension) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing reviews. Thanks![/size]

Please Log in or Create an account to join the conversation.

More
14 years 6 months ago #16824 by gswahhab
Big thanks on the nice easy fix ggppdk. This worked perfectly.

Please Log in or Create an account to join the conversation.

More
14 years 6 months ago #16826 by ggppdk
Here i write all modifications needed for (hopefully) all rules related to flexicontent:

In file:
plugins/system/alphauserpoints.php


replace all lines:
Code:
if ( $option=='com_content' )
with
Code:
if ( $option=='com_content' || $option=='com_flexicontent' )

THE above was a system plugin, bellow are content plugins:
BEWARE: Content plugins can triggered on multiple FlexiContent Fields.
Be sure to set the following content plugins to trigger ONLY for the item description (or only for only one flexicontent field??)

In version 1.5.6 final the following modifications for "view" are will not be needed,
and maybe, it will not be needed for "option" too.


In file:
plugins/content/sysplgaup_reader2author.php


replace lines 48-49:
and lines 120-123
Code:
case 'article' : if ( $option=='com_content' && $limitstart==0 ) {
with
Code:
case 'items': case 'article' : if ( ( $option=='com_content' || $option=='com_flexicontent' ) && $limitstart==0 ) {

In file:
plugins/content/sysplgaup_content.php


replace lines 73-76:
Code:
if ( $option=='com_content') { switch ( $view ) { case 'article' : if ( $option=='com_content' && $limitstart==0 ) {
with
Code:
if ( $option=='com_content' || $option=='com_flexicontent') { switch ( $view ) { case 'items' : case 'article' : if ( ( $option=='com_content' || $option=='com_flexicontent') && $limitstart==0 ) {


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star review. Thanks!

Please Log in or Create an account to join the conversation.

More
14 years 6 months ago #17344 by boulij
Thanks a lot ggppdk!
Now a user get some points when he's submitting an article with flexicontent thanks to the modification in "plugins/system/alphauserpoints.php"

But i didn't get what the modifications in "plugins/content/sysplgaup_reader2author.php" and in
"plugins/content/sysplgaup_content.php" are doing. Could you explain it to me please?

I also would like that a registered user earns some points when he's voting an article thanks to the flexicontent voting field. I changed "if ( ( $option=='com_content'" by "if ( ( $option=='com_content' || $option=='com_flexicontent')" in "plugins/system/alphauserpoints.php" on the line 145 (vote an article) but it's not working. Do you have a clue?

Again, thanks a lot.

Please Log in or Create an account to join the conversation.

More
14 years 6 months ago #17346 by ggppdk
About: sysplgaup_reader2author.php
This plugin for AlphaUserPoints assign x points to author when the article is read by any user ...

Points for voting will not work just by changing that line because votes are entered on different tables with fc, and it is not possible for me to tell what to change without installing and doing significant amount of work. Possible a new joomla plugin is needed that will detect sucessful votes and then call the alphauserpoints framework to add the points ...

Regards


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star review. Thanks!

Please Log in or Create an account to join the conversation.

More
13 years 8 months ago #24963 by GamerLive
Hello, you would know how to apply the same changes for FLEXIcontent V 2.0 RC5 r1273 and AlphaUserPoints 1.7.2 for joomla 2.5
Because we would really appreciate reading an article reports points to our members, but even with enabled plugins on the description field nothing happens

Sorry for my english

Portail communautaire sur l'univers des consoles Sony entièrement réalisé avec Flexicontent.

Please Log in or Create an account to join the conversation.

Moderators: vistamediajoomlacornerggppdk
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline
Save