Forum Moderators: coopster

Message Too Old, No Replies

Sef selfRelToAbs question

         

mochden

8:28 pm on Nov 9, 2007 (gmt 0)

10+ Year Member



hi guys im adding some content pages to our website using some php to pull table from mysql and displaying it with some simple paging php and what not. then using the wrapper to embedd them into joomla. now if you click something in this items they wont use our sef links, so i was tyring to use the sefRelToAbs funtion to hook them to our sef, here is the code im using if anyone can help me on how to implement this sefRelToAbs will be awesome, thanks in advance

<?php

require "config.php";
$page_name="art.php";
@$column_name=$_GET['column_name'];

$start=$_GET['start'];
if(!($start > 0)) {
$start = 0;
}

$eu = ($start - 0);
$limit = 10;
$this1 = $eu + $limit;
$back = $eu - $limit;
$next = $eu + $limit;

$query2=" SELECT * FROM jos_seyret_items WHERE catid='*36*#' ";
$result2=mysql_query($query2);
echo mysql_error();
$nume=mysql_num_rows($result2);

$bgcolor="#000000";
echo "<TABLE width=100% align=center border=0 cellpadding=7 cellspacing=0> <tr>";
echo "<td>&nbsp;</td><td><div align='right'><TABLE border=0 width=990 align=center cellpadding=7 cellspacing=0><tr><td width=760>&nbsp;</td><td><font size='1' color='#d0d0d0' face='menu,arial,helvetica'><b>Sort by:</font></td><td><a href='$page_name?column_name=addeddate'><font face='menu,arial,verdana,helvetica' color='#d0d0d0' size='1'>Date</font></a></td><td><a href='$page_name?column_name=title'><font face='menu,arial,helvetica' size='1' color='#d0d0d0'>Title</font></a></td><td><a href='$page_name?column_name=hit'><font face='menu,arial,helvetica' size='1' color='#d0d0d0'>Views</font></a></td><td><a href='$page_name?column_name=votetotal'><font face='menu,arial,helvetica' color='#d0d0d0' size='1'>Votes</font></a></td></tr></table></div></td>";

$query=" SELECT * FROM jos_seyret_items WHERE catid='*36*#' ";

if(isset($column_name) and strlen($column_name)>0){
$query = $query . " order by $column_name";
}
$query = $query. " limit $eu, $limit ";
$result=mysql_query($query);
echo mysql_error();

////////////////Here is where i need help to output the sef address rather than the 1 below/////////
while($noticia = mysql_fetch_array($result))
{
if($bgcolor=='#070707'){$bgcolor='#090909';}
else{$bgcolor='#070707';}

echo "<tr >";
echo "<td align=left bgcolor=$bgcolor id='title'><a href=http://www.example.com/index.php?option=com_seyret&Itemid=27&task=videodirectlink&id=$noticia[id] target=_top><img src=$noticia[picturelink] width=110 height=80 border='0'></a></td>";
echo "<td align=left bgcolor=$bgcolor id='title'><a href=http://www.example.com/index.php?option=com_seyret&Itemid=27&task=videodirectlink&id=$noticia[id] target=_top><font face='menu, arial, helvetica' size='4' color='#d0d0d0'><b>$noticia[title]</b></font></a></div><br \><br \><font face='arial' size='2' color='#ffffff'>$noticia[itemcomment]</font></td>";

echo "</tr>";
}
echo "</table>";

echo "<table align = 'center' width='50%'><tr><td align='left' width='30%'>";

if($back >=0) {
print "<a href='$page_name?start=$back&column_name=$column_name'><font face='menu, arial, helvetica' size='2' color='#d0d0d0'>PREV</font></a>";
}

echo "</td><td align=center width='30%'>";
$i=0;
$l=1;
for($i=0;$i < $nume;$i=$i+$limit){
if($i <> $eu){
echo " <a href='$page_name?start=$i&column_name=$column_name'><font face='menu, arial, helvetica' size='2' color='#d0d0d0'>$l</font></a> ";
}
else { echo "<font face='arial' size='4' color=red>$l</font>";}
$l=$l+1;
}

echo "</td><td align='right' width='30%'>";

if($this1 < $nume) {
print "<a href='$page_name?start=$next&column_name=$column_name'><font face='menu, arial, helvetica' size='2' color='#d0d0d0'>NEXT</font></a>";}
echo "</td></tr></table>";

?>

[edited by: jatar_k at 9:37 pm (utc) on Nov. 9, 2007]
[edit reason] please use example.com [/edit]

eelixduppy

6:30 pm on Nov 19, 2007 (gmt 0)



Hello and Welcome to WebmasterWorld!

It seems that this issue isn't very familiar with the users that frequent this forum. You might have better luck in the joomla forums.

eelixduppy

6:41 pm on Nov 19, 2007 (gmt 0)



Actually, have you tried to use the function within its context? Try something like this:

echo '<td align="left" bgcolor="'.$bgcolor.'" id="title">
<a href="'.sefRelToAbs("index.php?option=com_seyret&Itemid=27&task=videodirectlink&id=".$noticia['id']).'" target="_top">
<img src="'.$noticia['picturelink'].'" width="110" height="80" border="0"></a></td>";

See if that snippet works as you want.