Hi,

I am making a website for my gaming clan and was wondering whether someone would be able to help me with some php coding. I want to make a edit a module which I have so that it integrates a javascript code of this site. My website is www.clancgs.com. The module I want to edit is the top one showing pictures of all of the members from a certain team. I want it to look something like this where the team list scrolls across.

here is the coding for the joomla module


<?php
//Note modified by Suraj Reddy from the CB Connections module made by marcg[www.galangph.com]

// no direct access
defined( '_VALID_MOS' ) or die( 'Restricted access' );

global $database, $my, $mosConfig_live_site;

// Params
$team = $params->get('tname');
$img_path = $params->get('img_path');
$img_width = $params->get('img_width');
$img_height = $params->get('img_height');
$conn_count = $params->get('conn_count');
$num_column = $params->get('num_column');
$no_photo_img = $params->get('no_photo_img');
$friends_link = $params->get('members_link');


function getUsername($id){
global $database;

$sql = "select username from #__users where id = '$id' limit 1";

$database->setQuery($sql);
$r = $database->loadObjectList();

return $r[0]->username;
}

function getUserAvatar($id){
global $database;

$sql = "select avatar from #__comprofiler where id = '$id' limit 1";

$database->setQuery($sql);
$r = $database->loadObjectList();

return $r[0]->avatar;
}

function getItemid2(){
global $database;

$sql1 = "select `id` from #__components where `option` = 'com_comprofiler'";

$database->setQuery($sql1);


$rows = $database->loadObjectList();

$sql2 = "select `id` from #__menu where `componentid` = '". $rows[0]->id . "'";
$database->setQuery($sql2);
$rows=$database->loadObjectList();

return $rows[0]->id;
}


function connIsPending($id){
global $database;

$sql = "select memberid as id from #__comprofiler_members where referenceid = '$id' limit 1";

$database->setQuery($sql);
$member = $database->loadObjectList();

$sql = "select accepted from #__comprofiler_members where referenceid = '$member[0]->id' and memberid = '$id'";

$database->setQuery($sql);
$r = $database->loadObjectList();

return $r[0]->accepted;
}

$sql = "SELECT id AS mid FROM ((vwar_team INNER JOIN vwar_teammember ON vwar_team.teamid=vwar_teammember.teamid)
INNER JOIN vwar_member ON vwar_teammember.memberid = vwar_member.memberid AND vwar_team.teamname = '$team')
INNER JOIN #__users ON vwar_member.name = #__users.username
LIMIT $conn_count";

$database->setQuery($sql);
$u_conns = $database->loadObjectList();

$Itemid = getItemid2();

?>
<table cellspacing="0" width="100%" cellpadding="0" border="0" class="user_connections">
<tr>
<?php
$i = 1;
$r_cnt = 0;

foreach($u_conns as $u_conn){
echo '<td align="center" class="u_conn">';

if($img_width && $img_height){
$dims = 'width="' . $img_width . '" height="' . $img_height . '"';
} else {
$dims = '';
}

echo '<a href="' . $mosConfig_live_site . '/index.php?option=com_comprofiler&task=userProfile&Itemid='.$Itemid.'&user=' . $u_conn->mid . '">';

if( getUserAvatar($u_conn->mid) && getUserAvatar($u_conn->mid) != Null ){
echo '<img ' . $dims . ' border="0" src="' . $mosConfig_live_site . '/' . $img_path . '/' . getUserAvatar($u_conn->mid) . '" />'; } else {
echo '<img ' . $dims . ' border="0" src="' . $mosConfig_live_site . '/' . $no_photo_img . '" />';
}

echo '<br /></a>';

echo '<a href="' . $mosConfig_live_site . '/index.php?option=com_comprofiler&task=userProfile&Itemid='.$Itemid.'&user=' . $u_conn->mid . '">' . getUsername($u_conn->mid) . '</a><br />';

if(connIsPending($u_conn->mid)){
echo "[Pending]";
}

echo '</td>';

if($i == $num_column){
echo "</tr><tr>";
$i = 0;
}
$i++;
$r_cnt++;
}

?>
</table>
<?php

if($r_cnt >= $conn_count && $r_cnt != 0){
echo '<br /><a href="' . $mosConfig_live_site . '/index.php?option=com_vwar' . $members_link . '</a>';
} else if($r_cnt == 0){
echo '<br /><a href="' . $mosConfig_live_site . '/index.php?option=com_vwar"> Members </a>';
}
?>

Here is the javascript I want to use

<script type="text/javascript">

/***********************************************
* Conveyor belt slideshow script- Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/


//Specify the slider's width (in pixels)
var sliderwidth="400px"
//Specify the slider's height
var sliderheight="80px"
//Specify the slider's slide speed (larger is faster 1-10)
var slidespeed=<?php echo $spd; ?>
//configure background color:
slidebgcolor="#EAEAEA"

//Specify the slider's images
var leftrightslide=new Array()
var finalslide=''

<?php echo $bld; ?>


//Specify gap between each image (use HTML):
var imagegap=" "

//Specify pixels gap between each slideshow rotation (use integer):
var slideshowgap=5


////NO NEED TO EDIT BELOW THIS LINE////////////

var copyspeed=slidespeed
leftrightslide='<nobr>'+leftrightslide.join(imagegap)+'</nobr>'
var iedom=document.all||document.getElementById
if (iedom)
document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100px;left:-9000px">'+leftrightslide+'</span>')
var actualwidth=''
var cross_slide, ns_slide

function fillup(){
if (iedom){
cross_slide=document.getElementById? document.getElementById("test2") : document.all.test2
cross_slide2=document.getElementById? document.getElementById("test3") : document.all.test3
cross_slide.innerHTML=cross_slide2.innerHTML=leftrightslide
actualwidth=document.all? cross_slide.offsetWidth : document.getElementById("temp").offsetWidth
cross_slide2.style.left=actualwidth+slideshowgap+"px"
}
else if (document.layers){
ns_slide=document.ns_slidemenu.document.ns_slidemenu2
ns_slide2=document.ns_slidemenu.document.ns_slidemenu3
ns_slide.document.write(leftrightslide)
ns_slide.document.close()
actualwidth=ns_slide.document.width
ns_slide2.left=actualwidth+slideshowgap
ns_slide2.document.write(leftrightslide)
ns_slide2.document.close()
}
lefttime=setInterval("slideleft()",30)
}
window.onload=fillup

function slideleft(){
if (iedom){
if (parseInt(cross_slide.style.left)>(actualwidth*(-1)+8))
cross_slide.style.left=parseInt(cross_slide.style.left)-copyspeed+"px"
else
cross_slide.style.left=parseInt(cross_slide2.style.left)+actualwidth+slideshowgap+"px"

if (parseInt(cross_slide2.style.left)>(actualwidth*(-1)+8))
cross_slide2.style.left=parseInt(cross_slide2.style.left)-copyspeed+"px"
else
cross_slide2.style.left=parseInt(cross_slide.style.left)+actualwidth+slideshowgap+"px"

}
else if (document.layers){
if (ns_slide.left>(actualwidth*(-1)+8))
ns_slide.left-=copyspeed
else
ns_slide.left=ns_slide2.left+actualwidth+slideshowgap

if (ns_slide2.left>(actualwidth*(-1)+8))
ns_slide2.left-=copyspeed
else
ns_slide2.left=ns_slide.left+actualwidth+slideshowgap
}
}


if (iedom||document.layers){
with (document){
document.write('<table border="0" cellspacing="0" cellpadding="0"><td>')
if (iedom){
write('<div style="position:relative;width:'+sliderwidth+';height:'+sliderheight+';overflow:hidden">')
write('<div style="position:absolute;width:'+sliderwidth+';height:'+sliderheight+'" onMouseover="copyspeed=0" onMouseout="copyspeed=slidespeed">')
write('<div id="test2" style="position:absolute;left:0px;top:0px"></div>')
write('<div id="test3" style="position:absolute;left:-1000px;top:0px"></div>')
write('</div></div>')
}
else if (document.layers){
write('<ilayer width='+sliderwidth+' height='+sliderheight+' name="ns_slidemenu" bgColor='+slidebgcolor+'>')
write('<layer name="ns_slidemenu2" left=0 top=0 onMouseover="copyspeed=0" onMouseout="copyspeed=slidespeed"></layer>')
write('<layer name="ns_slidemenu3" left=0 top=0 onMouseover="copyspeed=0" onMouseout="copyspeed=slidespeed"></layer>')
write('</ilayer>')
}
document.write('</td></table>')
}
}
</script>

My knowledge of php and javascript is very small, and I am hoping to expand it. I hope this is a not too hard and is just a silly mistake on my behalf. If you can point me to somewhere to do some reading then I would be quite happy to do that.

Thanks