19 | 04 | 2024
Main menu
Login/Logout
 
Contacts
Реклама
Our button

Блог Ecolora

Код:

<a href="http://www.ecolora.com" target="_blank" rel="nothing" title="Ecolora.com"><img alt="Ecolora.com" height="31" src="http://www.ecolora.com/images/ecoloracom.gif" width="88" /></a>
Who's online

We have 60 guests and no members online

Лента новостей

Newsletter
Welcome, Guest
Username: Password: Remember me
Component and plugin for musical sites / Компонент для музыкальных сайтов и улучшенная версия плагина MP3 Browser
  • Page:
  • 1
  • 2

TOPIC: user must upload a file before download button appear

user must upload a file before download button appear 10 years 5 months ago #6901

  • admin
  • admin's Avatar
  • Offline
  • Администратор
  • Posts: 465
  • Thank you received: 40
  • Karma: 19
There're lines in VoteFile():
$user = &JFactory::getUser();
     $uid = $user->get('id');
     if (!$uid) $uid = 0;

So You can to use $uid in quiries there in that function.

Did You try to put the same code in UploadFile() function?

Aren't it working? Strange.
Last Edit: 10 years 5 months ago by admin.
The administrator has disabled public write access.

user must upload a file before download button appear 10 years 5 months ago #6902

  • joanprat
  • joanprat's Avatar
  • Offline
  • Новый участник
  • Posts: 5
  • Karma: 0
in function UploadFile I tried:

$user = &JFactory::getUser();
$uid = $user->get('uid');
if (!$uid) $uid = 0;


$db =& JFactory::getDBO();
$query = "UPDATE #__user_usergroup_map SET ddd=12 where user_id=".$uid."";
$db->setQuery( $query );
$db->query() or die( $db->stderr() );

always gets uid=0 because getuser() doesn't work.
I created a user with id=0 and then YES makes ddd=12

joan
The administrator has disabled public write access.

user must upload a file before download button appear 10 years 5 months ago #6903

  • admin
  • admin's Avatar
  • Offline
  • Администратор
  • Posts: 465
  • Thank you received: 40
  • Karma: 19
Ok. Then try to change in plugins/content/commedia/commedia.php that line:
'uploader' : '".$mosConfig_live_site."/index.php?option=com_commedia&format=raw&task=upload&folder=".$folder."',

to
'uploader' : '".$mosConfig_live_site."/index.php?option=com_commedia&format=raw&task=upload&folder=".$folder."&uid=".$uid."',

And in file.php in UploadFile() function put above that line:
$path = JPATH_SITE.DS.$_REQUEST['folder'];

the next line:
if (array_key_exists("uid", $_REQUEST) && is_numeric($_REQUEST['uid'])) $uid = $_REQUEST['uid'];
         else $uid = 0;

Hope it will help You.
Last Edit: 10 years 5 months ago by admin.
The administrator has disabled public write access.

user must upload a file before download button appear 10 years 5 months ago #6904

  • joanprat
  • joanprat's Avatar
  • Offline
  • Новый участник
  • Posts: 5
  • Karma: 0
YESSSSSS!!!!
It works!!!!!!

If someone is interested in doing this, just a field ddd in jos_user_usergroup_map

and modify plugin/commedia.php and component/models/file.php like attached

the only thing that would be needed to make it perfect is a popup when user has download his last of 12 files, but that is too much difficult for me...





thanks alot!!
joan
The administrator has disabled public write access.

user must upload a file before download button appear 10 years 5 months ago #6905

  • admin
  • admin's Avatar
  • Offline
  • Администратор
  • Posts: 465
  • Thank you received: 40
  • Karma: 19
Thank You for using Commedia. :)

You have to change the 'No Access Message' in Commedia content plugin's options. You could to put there information that user can to download 12 songs after he will upload something. ;)
The administrator has disabled public write access.
  • Page:
  • 1
  • 2
Time to create page: 0.067 seconds
for children older than 12 years