24
Hello every one!
I'm working on changes to modules yogurt 3.3 to make it similar to myspace. as the first amendment I put the player mp3 files on the main page of the profile. in the future I would like to put a player like that of jeroenwijering.com.
Here are the changes made
change the file templates/index.html with this
<{include file="db:yogurt_navbar.html"}> <{ if $petition==1 && $isOwner==1 && $isfriend==0}> <div id="yogurt-profile-petition" class="confirmMsg"> <h4><{$lang_youhavexpetitions}>h4> <img width="30" src="<{$xoops_url}>/uploads/<{$petitioner_avatar}>" /> <form action="makefriends.php" method="post"> <{$lang_askingfriend}> <ul> <li> <input name="level" type="radio" value="0" /> <{$lang_rejected}> li> <li> <input name="level" type="radio" value="1" /> <{$lang_accepted}> li> <li> <input name="level" type="radio" value="3" /> <{$lang_acquaintance}> li> <li> <input name="level" type="radio" value="5" /> <{$lang_friend}> li> ul> <input type="hidden" name="petition_id" id="petition_id" value="<{$petition_id}>" /> <input type="submit" /> <{$token}> form> div> <{else}> <{if (($isfriend!=1) && ($isOwner==0) && ($isanonym!=1))}> <div id="yogurt-profile-petition"> <form action=submit_friendpetition.php method="post"> <{$lang_askusertobefriend}><input type="hidden" name="petitioned_uid" id="petitioned_uid" value="<{$uid_owner}>" /> <input name="" type="image" src="images/addfriend.jpg"/><{$token}> form> div> <{ /if }> <{ /if }> <{ if $allow_friends }> <div class="yogurt-nav-bar" id="yogurt-nav-bar"> <p id="yogurt-profile-fans"><a href="fans.php?uid=<{$uid_owner}>" alt="<{$lang_fans}>" title="<{$lang_fans}>" > <{$lang_fans}> a><img src="images/fans.gif" /> ( <{$nb_fans}> ) | <{$lang_trusty}> p> <p id="trustybw"> <span id="trustycolor"> <img width="<{$trusty}>" height="0" src="images/transparent.gif" />span> <img width="<{$trusty_rest}>" height="0" src="images/transparent.gif" />p> | <{$lang_cool}> <p id="coolbw"> <span id="coolcolor"> <img width="<{$cool}>" height="0" src="images/transparent.gif" />span> <img width="<{$cool_rest}>" height="0" src="images/transparent.gif" />p> | <{$lang_sexy}> <p id="sexybw"> <span id="sexycolor"> <img width="<{$sexy}>" height="0" src="images/transparent.gif" />span> <img width="<{$sexy_rest}>" height="0" src="images/transparent.gif" />p> div> <{/if}> <div class="yogurt-profile-group1"> <{ if $allow_pictures || $allow_videos }> <div id="yogurt-profile-visual" class="outer"> <h2 class="yogurt-profile-title head"> <{$owner_uname}> h2> <{ if $allow_pictures }> <div id="yogurt-profile-avatar"> <{if $avatar_url!="" && $avatar_url!="blank.gif" }> <img src="<{$xoops_url}>/uploads/<{$avatar_url}>" /> <{ else }> <img src="images/noavatar.gif" > <{if $isOwner}> <p> <{$lang_selectavatar}> p> <{ else }> <p> <{$lang_noavatar}> p> <{/if}> <{ /if }> div> <{/if}> div> <{/if}> <{ if ($isOwner==1) }> <div id="yogurt-album-visitors" class="outer"> <h2 class="head"><{$lang_visitors}>h2> <p> <{foreach from=$visitors key=k item=v}> <a href=index.php?uid=<{$k}> > <{$v}> a> <{/foreach}> p> div> <{ /if }> <{ if $allow_profile_general==1}> <div id="yogurt-profile-details" class="outer"> <h2 class="yogurt-profile-title head"><{$lang_detailsinfo}> <{ if $isOwner==1 }> <a href="edituser.php" title="<{$lang_editprofile}>" ><img src="images/edit.gif" />a> <{/if}>h2> <p class="odd"><img src="images/username.gif" /><span class="yogurt-profileinfo-label"><{$lang_uname}>:span><span class="yogurt-profileinfo-value"><{$user_uname}>span>p> <p class="even"><img src="images/username.gif" /><span class="yogurt-profileinfo-label"><{$lang_realname}>:span><span class="yogurt-profileinfo-value"><{$user_realname}>span>p> <p class="odd"> <img src="images/house.gif" /> <span class="yogurt-profileinfo-label"><{$lang_location}>:span><span class="yogurt-profileinfo-value"><{$user_location}>span><a href="http://maps.google.com/?q=<{$user_location}>" target="_blank" ><img src="images/mapsgoogle.gif" />a>p> <p class="even"> <img src="images/occ.gif" /> <span class="yogurt-profileinfo-label"><{$lang_occupation}>:span><span class="yogurt-profileinfo-value"><{$user_occupation}>span>p> <p class="odd"> <img src="images/interests.gif" /> <span class="yogurt-profileinfo-label"><{$lang_interest}>:span><span class="yogurt-profileinfo-value"><{$user_interest}>span>p> <p class="even"> <img src="images/bio.gif" /> <span class="yogurt-profileinfo-label"><{$lang_extrainfo}>:span>p> <p class="yogurt-profileinfo-valuebigtext odd"><{$user_extrainfo}>p> div> <{ /if }> <{ if $allow_profile_contact==1}> <div id="yogurt-profile-details" class="outer"> <h2 class="yogurt-profile-title head"><{$lang_contactinfo}> <{ if $isOwner==1 }> <a href="edituser.php" title="<{$lang_editprofile}>" ><img src="images/edit.gif" />a> <{/if}>h2> <p class="even"> <img src="images/url.gif" /> <span class="yogurt-profileinfo-label"><{$lang_website}>:span><span class="yogurt-profileinfo-value"><{$user_websiteurl}>span>p> <p class="odd"> <img src="images/email.gif" /> <span class="yogurt-profileinfo-label"><{$lang_email}>:span><span class="yogurt-profileinfo-value"><{ mailto address=$user_email encode="javascript"}>span>p> <{ if $isanonym!=1 && $isOwner!=1 }> <p class="even"> <img src="images/email.gif" /> <span class="yogurt-profileinfo-label"><{$lang_privmsg}>:span><span class="yogurt-profileinfo-value"><a href="javascript:openWithSelfMain('<{$xoops_url}>/pmlite.php?send2=1&to_userid=<{$uid_owner}>', 'pmlite', 450, 380);"><img src="<{$xoops_url}>/images/icons/pm.gif" alt="Send Private Message to suico" />a>span>p> <{ /if }> <p class="odd"> <img src="images/icq.gif" /> <span class="yogurt-profileinfo-label"><{$lang_icq}>:span><span class="yogurt-profileinfo-value"><{$user_icq}>span> p> <p class="even"> <img src="images/aim.gif" /> <span class="yogurt-profileinfo-label"><{$lang_aim}>:span><span class="yogurt-profileinfo-value"><{$user_aim}>span>p> <p class="odd"> <img src="images/ym.gif" /> <span class="yogurt-profileinfo-label"><{$lang_yim}>:span><span class="yogurt-profileinfo-value"><{$user_yim}>span>p> <p class="even"> <img src="images/amsn.gif" /> <span class="yogurt-profileinfo-label"><{$lang_msnm}>:span><span class="yogurt-profileinfo-value"><{$user_msnm}>span>p> div> <{ /if }> <{ if $allow_profile_stats}> <div id="yogurt-profile-statistics" class="outer"> <h2 class="yogurt-profiletitle head"><{$lang_statistics}>h2> <p class="odd"> <img src="images/birthday.gif" /> <span class="yogurt-profileinfo-label"><{$lang_membersince}>:span><span class="yogurt-profileinfo-value"><{$user_joindate}>span>p> <p class="even"> <img src="images/rank.gif" /> <span class="yogurt-profileinfo-label"><{$lang_rank}>:span><span class="yogurt-profileinfo-value"><{$user_rankimage}> <{$user_ranktitle}>span>p> <p class="odd"> <img src="images/comments.gif" /> <span class="yogurt-profileinfo-label"><{$lang_posts}>:span><span class="yogurt-profileinfo-value"><{$user_posts}>span>p> <p class="even"> <img src="images/clock.gif" /> <span class="yogurt-profileinfo-label"><{$lang_lastlogin}>:span><span class="yogurt-profileinfo-value"><{$user_lastlogin}>span>p> <p class="odd"> <img src="images/signature.gif" /> <span class="yogurt-profileinfo-label"><{$lang_signature}>:span>p> <p class="yogurt-profileinfo-valuebigtext even"><{$user_signature}>p> div> <{ /if }> <div id="yogurt-profile-search-results" class="outer"> <h2 class="yogurt-profiletitle head"><{$lang_usercontributions}>h2> <{foreach item=module from=$modules name="search_results"}> <div class="yogurt-profile-search-module" id="yogurt-profile-search-module-<{$smarty.foreach.search_results.iteration}>" > <h4 class="yogurt-profiletitle head"> <a class="yogurt-profile-search-module-title" id="yogurt-profile-search-module-title-<{$smarty.foreach.search_results.iteration}>" > <img src="images/toggle.gif" /> a> <{$module.name}> h4> <div class="yogurt-profile-search-module-results" id="yogurt-profile-search-module-results-<{$smarty.foreach.search_results.iteration}>"> <{foreach item=result from=$module.results}> <p class="<{ cycle values="odd,even"}>"> <img src="<{$xoops_url}>/<{$result.image}>" alt="<{$module.name}>" /> <b> <a href="<{$xoops_url}>/<{$result.link}>"> <{$result.title}> a> b><br /> <small>(<{$result.time}>)small> p> <{/foreach}> <p> <{$module.showall_link}> p> div> div> <{/foreach}> div> div> <div class="yogurt-profile-group2"> <div id="yogurt-profile-friends" class="outer"> <h2 id="yogurt-audio-allaudiotitle" class="head"> <{$player_from_list}> h2> <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="240" height="20" id="dewplayer" align="middle"><param name="wmode" value="transparent"><param name="allowScriptAccess" value="sameDomain" /><param name="movie" value="audioplayers/dewplayer-multi.swf?mp3=<{$audio_list}>" /><param name="quality" value="high" /><param name="bgcolor" value="FFFFFF" /><embed src="audioplayers/dewplayer-multi.swf?mp3=<{$audio_list}>" quality="high" bgcolor="FFFFFF" width="240" height="20" name="dewplayer" wmode="transparent" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer">embed>object> div> <div id="yogurt-profile-friends" class="outer"> <h2 id="titulo-friends" class="head"><{$lang_videos}> ( <{$nb_videos}> )h2> <{ if $allow_videos==1 }> <div id="yogurt-profile-tribe"> <{if $mainvideocode!="" }> <object width="200" height="150"> <param name="movie" value="http://www.youtube.com/v/<{$mainvideocode}>" /> <param name="wmode" value="transparent" /> <embed src="http://www.youtube.com/v/<{$mainvideocode}>" type="application/x-shockwave-flash" wmode="transparent" width="200" height="150" /> object> <p id="yogurt-profile-mainvideo-desc"> <{$mainvideodesc}> p> <{ else }> <img src="images/novideo.gif" > <{if $isOwner}> <p> <{$lang_selectmainvideo}> p> <{else}> <p> <{$lang_nomainvideo}> p> <{/if}> <{ /if }> div> <{/if}> div> <{ if $allow_friends==1 }> <div id="yogurt-profile-friends" class="outer"> <h2 id="titulo-friends" class="head"><{$lang_friendstitle}> ( <{$nb_friends}> )h2> <{if $nb_friends==0}><p id="nofriends"><{$lang_nofriendsyet}>p><{ /if }> <{section name=i loop=$friends}> <div class="yogurt-profile-friend <{cycle values="odd,even"}>"> <a href="<{$xoops_url}>/modules/yogurt/index.php?uid=<{$friends[i].uid}>" alt="<{$friends[i].uname}>" title="<{$friends[i].uname}>"><{ if $friends[i].user_avatar=="blank.gif"}><img class="yogurt-profile-friend-photo" src="images/noavatar.gif"><{ else }><img class="yogurt-profile-friend-photo" src="<{$xoops_upload_url}>/<{$friends[i].user_avatar}>"><{/if}><{$friends[i].uname}> a> div> <{/section}> <p id="yogurt-profile-friend-viewall" class="foot"> <a href="friends.php?uid=<{$uid_owner}>"><{$lang_viewallfriends}>a> p> div> <{ /if }> <{ if $allow_tribes==1}> <div id="yogurt-profile-tribes" class="outer"> <h2 class="yogurt-profiletitle head"><{$lang_tribes}> (<{$nb_tribes}>)h2> <{if $nb_tribes==0}><p id="notribes"><{$lang_notribesyet}>p><{ /if }> <{section name=i loop=$tribes}> <div class="yogurt-profile-tribe <{cycle values="odd,even"}>"> <a href="tribe.php?tribe_id=<{$tribes[i].tribe_id}>"><img alt="<{$tribes[i].title}>" title="<{$tribes[i].title}>" class="yogurt-profile-tribes-img" src="<{$xoops_upload_url}>/<{$tribes[i].img}>" />a> <h4> <{$tribes[i].title}> h4><p><{$tribes[i].desc}>p> div> <{/section}> <p id="yogurt-profile-friend-viewall" class="foot"> <a href="tribes.php?uid=<{$uid_owner}>"><{$lang_viewalltribes}>a> p> div> <{ /if }> div> <{include file="db:yogurt_footer.html"}>
in file yogurt/index.php insert this code between the line 40 and 74
//////////////////modifica urbanspaceman
$controler_audio = new YogurtAudioControler($xoopsDB,$xoopsUser);
/**
* Fecthing numbers of tribes friends videos pictures etc...
*/
$nbSections = $controler_audio->getNumbersSections();
$start_audio = (isset($_GET['start_audio']))? intval($_GET['start_audio']) : 0;
/**
* Criteria for Audio
*/
$criteriaUidAudio = new criteria('uid_owner',$controler_audio->uidOwner);
$criteriaUidAudio->setStart($start_audio);
$criteriaUidAudio->setLimit($xoopsModuleConfig['audiosperpage']);
/**
* Get all audios of this user and assign them to template
*/
$audios = $controler_audio->getAudio($criteriaUidAudio);
$audios_array = $controler_audio->assignAudioContent($nbSections['nbAudio'],$audios);
if(is_array($audios_array))
{
$xoopsTpl->assign('audios', $audios_array);
$audio_list = '';
foreach($audios_array as $audio_item) {$audio_list .= '../../uploads/yogurt/mp3/'.$audio_item['url'].' | ';}
//$audio_list = substr($audio_list,-2);
$xoopsTpl->assign('audio_list',$audio_list);
}
else {$xoopsTpl->assign('lang_noaudioyet',_MD_YOGURT_NOAUDIOYET);}
/////////////////fine modifica urbanspaceman
Fun!
Urban