CB Donate Me Doesnt Integrate 100%....

  • redflame
  • Topic Author
  • Offline
  • New Member
  • New Member
More
13 years 10 months ago - 13 years 10 months ago #3571 by redflame
CB Donate Me Doesnt Integrate 100%.... was created by redflame
I have paid for both the Donate Component and the CB Donate Me plugin

Together they DO NOT WORK 100%

I have sent a number of emails requesting support with no response - please let me know where emails are supposed to be addressed. This is otherwise a great script and I will be more than happy to give it a positive review on the basis i can get support.

This is the problem with the script.

When a donation is made the data is posted into the jd_donate table - however the userid is posted to receive_user_id only. It also needs to be posted to userid.

Without posting to the userid as well as receive_user_id - when you view the donor management in the backend the username list will be blank if the donation has been made using CB Donate Me - as it tried to populate that field from the userid mentioned above in jd_donate table which will be empty as i have identified.

Can you please advise/fix or tell me where to change the code.


Additionally i do not know where i am supposed to go to get upgrades to the script or where to download the script again? Can you please advise - i have also had to create a new user account as i was unable to login with my old credentials...
Last edit: 13 years 10 months ago by redflame.

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

More
13 years 10 months ago #3573 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Re:CB Donate Me Doesnt Integrate 100%....
Hi

For supporting , please use support ticket system . It is better to check support tickets system than via email because I receive many emails everyday from the site (user registrations, forum notifications, support request....) .

Regarding your problem, It is not a bug :

- receive_user_id : that is the id of user who make donation .
- user_id : that is the id of the user who is making donation .

The user_id don't need to be posted . It can be get automatically from Joomla system :
Code:
$row->user_id = $user->get('id');

So basically, if you are logged in while making donation, user_id field will be your user id . If you are not logged in, the field will be set to 0 .

You can find that line of code in the line 48 of the file components/com_jdonation/models/jdonation.php .

Hope the explanation is clear to you .

Thanks ,

Ossolution Team

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

  • redflame
  • Topic Author
  • Offline
  • New Member
  • New Member
More
13 years 10 months ago - 13 years 10 months ago #3574 by redflame
Replied by redflame on topic Re:CB Donate Me Doesnt Integrate 100%....
i will create a video and show you what i mean... this doesnt resolve the problem

cheers for responding though

in the mean time - if you go to menu management in the back end

pull up a list of all the people who have donated through CB Donate Me... it shows you who made the donation but not who the donation was for....

the username column will be empty...

however if you look at a CB users donation history on the front end it will show you who donated to them...

the only way i am able to resolve this is to manually change it in the database or manually assign the payments via the admin backend....


i dont know what file displays the data on the backend however i would suggest a simple if statement...

ie if userid = 0 show receive_user_id

am not to versed on coding so not exactly show where to apply this...

hope this makes sense till i can document it further...


theres two folders donor and donors - which is the one that displays the details in the backend donation manager?

cheers
Last edit: 13 years 10 months ago by redflame.

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

More
13 years 10 months ago #3575 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Re:CB Donate Me Doesnt Integrate 100%....
Hi

Feel free to submit a support ticket contains FTP account and Joomla administrator account of your site . I will do the customization for you . It should not take much time for doing that .

I understand what you want now and happy to assist you .

Thanks ,

Tuan

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

  • redflame
  • Topic Author
  • Offline
  • New Member
  • New Member
More
13 years 10 months ago - 13 years 10 months ago #3576 by redflame
Replied by redflame on topic Re:CB Donate Me Doesnt Integrate 100%....
hi tuan i manged to fix it....

probably not the neatest of code but it works...

in administrator/components/jdonation/donors/tmpl/default.php around line 115 i found this...
Code:
<?php if ($row->user_id) { ?> <a href="index.php?option=com_users&view=user&task=edit&cid[]=<?php echo $row->user_id; ?>"> <?php echo $row->username; ?> </a> <?php }

at line 120 i added this... dont laugh like i said not the neatest but it works if you can clean up the code it will be appreciated or if you know of a simpler way to fix please let me know :)
Code:
else { ?> <?php $donation_id = $row->id; // GET RECEIVE USER ID $db =& JFactory::getDBO(); $query = "SELECT * FROM t0r4j_jd_donors WHERE id = $donation_id"; $db->setQuery($query); $row = $db->loadAssoc(); $newuserid = $row[receive_user_id]; // GET RECEIVERS USER ID $query = "SELECT * FROM t0r4j_users WHERE id = $newuserid"; $db->setQuery($query); $row = $db->loadAssoc(); $receivers_name = $row[username]; ?> <a href="index.php?option=com_users&view=user&task=edit&cid[]=<?php echo $newuserid; ?>"> <?php echo $receivers_name; ?> </a> <?php }

basically now if it finds a userid field blank due to the CB Donate Me it queries the receive_user_id and posts the username based on that id

HTH

whats weird now is i have found 2 donations with blank userid and blank receive_user_id???

UPDATE this breaks displaying the other fields - may need to change some of the variable names... will update shortly...

i prefixed all my new queries etc with fix ie $fixdb
Last edit: 13 years 10 months ago by redflame.

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

More
13 years 10 months ago #3577 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Re:CB Donate Me Doesnt Integrate 100%....
That works . However, It is not good in coding . I am finishing new version of an extension (Documents Seller) at the moment. Later today, I will post the patch for your problem which works better .

BTW , thanks for sharing the code .

Regards ,

Tuan

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

  • redflame
  • Topic Author
  • Offline
  • New Member
  • New Member
More
13 years 10 months ago - 13 years 10 months ago #3578 by redflame
Replied by redflame on topic Re:CB Donate Me Doesnt Integrate 100%....
hi tuan,

yeah with the above code it broke displaying some of the other data....


look forward to seeing your patch - it will also help me code better, would you please identify what you do to make it neater!

cheers
Last edit: 13 years 10 months ago by redflame.

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

More
13 years 10 months ago #3579 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Re:CB Donate Me Doesnt Integrate 100%....
I will upload the patch later today as promised . Here are some comments to your code :

- You get username of the receiver user in the loop and the system will have to query the database in each loop . That's not good for performance (It is OK in this case because the data is not large ) . The solution is we modify the query in the model to get the receive username within one SQL . I will post it here later .

- You modified the code here, so you will not be able to see username of the donor . The solution is we add a new column in the list called receive username .

- If we turn on error reporting, there will be some warning in your code . So you should write the code like that :
Code:
$newuserid = $fixrow['receive_user_id']

instead of writting :
Code:
$newuserid = $fixrow[receive_user_id]

- The variable like $newuserid is not follow naming convention of php programming :) .


Hope my comment is useful for you .

Thanks ,

Tuan

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

Moderators: Mr. DamDũng Nguyễn Việt