18 | 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 64 guests and no members online

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

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

TOPIC: How to show music from user's folder in JomSocial

How to show music from user's folder in JomSocial 11 years 1 month ago #6669

  • admin
  • admin's Avatar
  • Offline
  • Администратор
  • Posts: 465
  • Thank you received: 40
  • Karma: 19
Yesterday, one custumer asked me, if there any abilities to show music from own user's folder on the user profile page.

He has music folder and subfolder for every site's user in it. For example:

music->John
music->ecolora
music->Anna


and others. The name of the folder is equal to the username.

If so and You want to show music on, You need to do that simple steps:

1. Download and install Sourcerer extenstion: extensions.joomla.org/extensions/core-en...code-in-content/5051
2. Download and install Advanced module manager extension: extensions.joomla.org/extensions/style-a...les-management/10307
3. Create new Custom html module. You'll see there 'Insert code' button at the bottom. Press on it.
4. Put next code to the popup window:
{ commedia }{source}<?php
    $uid = $_REQUEST['userid'];
    if (!$uid) $uid = 0;
    $db =& JFactory::getDBO();
    $db->setQuery("SELECT username FROM #__users WHERE id=".$uid);
    if ($db->query()) {
        $line=$db->loadObject();
        echo 'music/'.$line->username;
    }
    ?>{/source}{ /commedia }

Don't forget to replace { commedia } to {commedia} and other tags. :) (just remove spaces there).

Insert it.

5. Press on the Module Assignment at the right side of the module options.

6. Select there Url - Include, and type:
&view=profile&userid=

7. Save the module.

Check it on the User profile tab (not Yours but other users). Mudule must be shown only on the user profile page and show files from music/username folder.
Last Edit: 11 years 3 weeks ago by admin.
The administrator has disabled public write access.

How to show music from user's folder 11 years 1 month ago #6670

  • admin
  • admin's Avatar
  • Offline
  • Администратор
  • Posts: 465
  • Thank you received: 40
  • Karma: 19
If You want to show music files on the own user's profile page, use that code, please:
{ commedia }{source}<?php
    $user = &JFactory::getUser();
    $uid = $user->get('id');
    if (!$uid) $uid = 0;
    $db =& JFactory::getDBO();
    $db->setQuery("SELECT username FROM #__users WHERE id=".$uid);
    if ($db->query()) {
        $line=$db->loadObject();
        echo 'music/'.$line->username;
    }
    ?>{/source}{ /commedia }
Last Edit: 11 years 1 month ago by admin.
The administrator has disabled public write access.

How to show music from user's folder 11 years 1 month ago #6678

  • admin
  • admin's Avatar
  • Offline
  • Администратор
  • Posts: 465
  • Thank you received: 40
  • Karma: 19
Also You can install Advanced Module Manager on Your site, and using it's 'Include (Exclude) by URL' option, set up, where every module must to show: on Your profile page, or on other user's profile pages.
Last Edit: 11 years 1 month ago by admin.
The administrator has disabled public write access.

How to show music from user's folder 10 years 5 months ago #6909

  • admin
  • admin's Avatar
  • Offline
  • Администратор
  • Posts: 465
  • Thank you received: 40
  • Karma: 19
The administrator has disabled public write access.
Time to create page: 0.363 seconds
for children older than 12 years