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.