include '../config.php';
$link = mysql_connect( $citatepedia_serv, $citatepedia_user, $citatepedia_pass );
if ( ! $link )
die( "Couldn't connect to MySQL" );
else
{
mysql_select_db( $citatepedia_data,$link ) or die ( "Couldn't open database: ".mysql_error() );
if ($d=='') echo '
';
echo '
';
$autor_label=stripslashes(urldecode($a));
$sursa_label=stripslashes(urldecode($d));
if (strtolower(substr($sursa_label,0,1))==substr($sursa_label,0,1))
{
if ($autor_label<>'') echo $autor_label.' în ';
echo $sursa_label;
}
else
{
echo $sursa_label;
if ($autor_label<>'') echo ' de '.$autor_label;
}
?>
include "../header_top.php";
include "header_general.php";
if ($a<>'') $resultev = mysql_query( 'SELECT * FROM citatepedia_date WHERE autor="'.mysql_real_escape_string($a).'" ORDER BY anul,tip', $link ) or die ( "Couldn't select: ".mysql_error() );
if (strpos($_SERVER['REQUEST_URI'],'a=')!==false) $cond="autor='".mysql_real_escape_string($a)."' AND sursa='".mysql_real_escape_string($d)."'";
else $cond="sursa='".mysql_real_escape_string($d)."' AND tip<>'p'";
$result = mysql_query( "SELECT COUNT(*) AS _items FROM citatepedia WHERE ".$cond, $link ) or die ( "Couldn't select: ".mysql_error() );
$row = mysql_fetch_array( $result );
$items = $row['_items'];
if ($items>0)
{
echo '
';
if (strtolower(substr($sursa_label,0,1))==substr($sursa_label,0,1))
{
if ($autor_label<>'') echo $autor_label.' în ';
echo ''.$sursa_label.'';
}
else
{
echo ''.$sursa_label.'';
if ($autor_label<>'') echo ' de '.$autor_label;
}
echo '
';
include '../meniu_sursa.php';
}
include "../header_content.php";
$mycontext_author=$autor_label;
$mycontext_title=$sursa_label;
$mycontext_order='data_extern DESC';
$mycontext_limit='1';
$result = mysql_query( "SELECT * FROM citatepedia WHERE ".$cond." ORDER BY calitate DESC,voturi DESC,recomandari DESC,lungime LIMIT ".(($p-1)*$perpage).','.$perpage, $link ) or die ( "Couldn't select: ".mysql_error() );
$show_subjects=true;
include "../show_list.php";
include "../navig.php";
if (strlen($d)>1)
{
echo '