Prse Error, Unexpected $end

Started on the old forum in April 2008 · view the original in the archive · old links redirect here

5 replies · 760 views · started 18 years ago · 1 min read

3 participants
laro696 Developer · 205 posts #1

i get this error in my script

parse error, unexpected $end in C:\Program Files\EasyPHP 2.0b1\www\lyrics\upload\index.php on line 347

here's line 347

include 'template.php';
WhiteWarrior Principal · 1,419 posts #2

i get this error in my script

parse error, unexpected $end in C:\Program Files\EasyPHP 2.0b1\www\lyrics\upload\index.php on line 347

here's line 347

include 'template.php';

upload the index.php here and we will help

laro696 Developer · 205 posts #3
<?php
error_reporting(E_ALL);

function main()
{
    global $youtube;
    $db = new mysql();
    $lyric_str="";
    if(isset($_REQUEST["lyric_id"]) && ($_REQUEST["lyric_id"] != 0 ))
    {
        $lyric_id = $_REQUEST["lyric_id"];
        $lyric_str = " `lyric_id` = ".$lyric_id;
    }
    if(!isset($_REQUEST["lyric_id"]) && !isset($_REQUEST["do"]))
    {
?>
<table width="100%" cellpadding="0px" cellspacing="0px" border="0px">
<tr height="49px">
<td colspan="2" class="poemhead">[b]News[/b]</td>
</tr>
</table>
<?
        $rows = $db->easy_get_rows("SELECT * FROM news ORDER BY news_date DESC limit 4");
        foreach($rows as $mysql_array)
        {
?>
<div class="news_frame" id="news_id#<?=$mysql_array['news_id'];?>">
    <div class="news_title"><?=$mysql_array['news_title'];?> posted on: <?=$mysql_array['news_date'];?></div>
    <div class="news_content"><?=$mysql_array['news_text'];?></div>
</div>
<?
        }
    }
    if(count($_POST) != 0)
    {
        $lyric = $_REQUEST["lyric"];
        $score = $_REQUEST["score"];
        $lyric_id = $_REQUEST["lyric_id"];
//        $db = new mysql();
//        $db->query("UPDATE `lyrics` SET `score` = `score` + ".$score.", `no_of_ratings` = `no_of_ratings` + 1 WHERE `lyric_id`= ".$lyric_id);
        $affected_rows = mysqlQuery("UPDATE `lyrics` SET `score` = `score` + ".$score.", `no_of_ratings` = `no_of_ratings` + 1 WHERE `lyric_id`= ".$lyric_id);
//        $affected_rows = $db->num_rows();
        if($affected_rows == 1)
        {
            echo "Thanks for rating this lyric";
        }else
        {
            echo "Unable to complete operation, Please try again";
        }
        $lyric_str = "";
        if(isset($_REQUEST["lyric_id"]) && ($_REQUEST["lyric_id"] != 0 ))
        {
            $lyric = 1;
            $lyric_id = $_REQUEST["lyric_id"];
            $lyric_str = "`lyric_id` = ".$lyric_id;
        }
    }
    if(isset($_REQUEST["lyric_id"]) && ($_REQUEST["lyric_id"] != 0 ))
    {
//        if (isset($_SESSION["view$lyric_id"]) && $_SESSION["view$lyric_id"]==TRUE)
//        {
            $db = new mysql;
            $db->query("UPDATE `lyrics` SET `views` = `views` + 1 WHERE `lyric_id` = ".$lyric_id);
//            $_SESSION["view".$lyric_id] = TRUE;
//        }
        $mysql_array = $db->easy_get_row("SELECT * FROM `lyrics` WHERE $lyric_str AND `approved` = '1'");
        $lyric = $mysql_array;
        $num_rows = $db->num_rows();
            if ($num_rows == 1)
        {
?>
<table width="100%" cellpadding="0px" cellspacing="0px" border="0px">
<tr height="49px">
<td colspan="2" class="poemhead">[b]<?=$mysql_array['lyric_artist']?>[/b] - <?=$mysql_array['lyric_title']?>   <?php
function curPage1()
{
    $url = "http://www.$_SERVER[SERVER_NAME]/printf.php";

    if (isset($_SERVER['QUERY_STRING']) AND !empty($_SERVER['QUERY_STRING']))
    {
        $url .= "?$_SERVER[QUERY_STRING]";
    }
    return $url;
}
?>
  [url="print/<?php echo preg_replace('/([^a-zA-Z0-9]+)/', '-', $mysql_array['lyric_artist'])."].html" target="_blank">[img]/images/icon_print_page.gif[/img][/url] <a href="/print/<?php echo preg_replace('/([^a-zA-Z0-9]+)/', '-', $mysql_array['lyric_artist'])."/".$mysql_array['lyric_id']."-".preg_replace('/([^a-zA-Z0-9]+)/', '-', $mysql_array['lyric_title']) ?>.html" target="_blank">Printer friendly page 

</a>
</td>
</tr>
</table>
<div class="news_frame">
<div class="bookmarks">
  

  
    <?php
function curPage()
{
    $url = "http://$_SERVER[SERVER_NAME]$_SERVER[SCRIPT_NAME]";

    if (isset($_SERVER['QUERY_STRING']) AND !empty($_SERVER['QUERY_STRING']))
    {
        $url .= "?$_SERVER[QUERY_STRING]";
    }
    return $url;
}
function create_link($artist, $title, $id)
{
    return "http://www.yourdomain.com/".preg_replace('/([^a-zA-Z0-9]+)/', '-', $artist)."/".$id."-".preg_replace('/([^a-zA-Z0-9]+)/', '-', $title).".html";
}
$link = create_link($mysql_array['lyric_artist'], $mysql_array['lyric_title'], $mysql_array['lyric_id']);
?>
Add to: | [url="http://del.icio.us/post?url=<?php echo $link ?>;title=Exciting new lyrics and videos!"][img]/images/delicious.png[/img][/url][url="http://del.icio.us/post?url=<?php echo $link ?>;title=Exciting new lyrics and videos!"][/url] [url="http://www.google.com/bookmarks/mark?op=edit&output=popup&bkmk=<?php echo $link ?>&title=Exciting new lyrics and videos!"][img]/images/google.png.jpg[/img][/url] [url="http://www.furl.net/storeIt.jsp?u=<?php echo $link ?>&t=Exciting+new+lyrics+and+videos!"][img]/images/furl.png[/img][/url] [url="http://www.netscape.com/submit/?U=<?php echo $link ?>&T=Exciting new lyrics and videos!"][img]/images/netscape.gif[/img][/url] [url="http://www.newsvine.com/_tools/seed&save?u=<?php echo $link ?>&h=Exciting new lyrics and videos!"][img]/images/newsvine.png[/img][/url] [url="http://www.rawsugar.com/tagger/?turl=<?php echo $link ?>&tttl=Exciting new lyrics and videos! "][img]/images/rawsugar.png[/img][/url] [url="http://reddit.com/submiturl=<?php echo $link ?>&title=Exciting new lyrics and videos!"][img]/images/reddit.png[/img][/url] [url="http://www.squidoo.com/lensmaster/bookmark?<?php echo $link ?>&title=Exciting new lyrics and videos!"][img]/images/squidoo.png[/img][/url] [url="http://www.stumbleupon.com/submit?url=<?php echo $link ?>&title=Exciting new lyrics and videos!"][img]/images/stumbled.png.gif[/img][/url] [url="http://technorati.com/faves?add=<?php echo $link ?>"][img]/images/technorati.png[/img][/url] [url="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=<?php echo $link ?>&t=Exciting%20new%20lyrics%20and%20videos!"][img]/images/yahoo.png[/img][/url]

[url="/taf.php"][img]/images/taf.png[/img][/url][url="/taf.php"]Tell a Friend[/url]

  </p>
  </div>
<?php
        }
        else
        {
            echo 'Query did not do what we wanted it to do, sorry';
        }
        $trunc_lyric= nl2br($mysql_array['lyric_text']);
        echo $trunc_lyric;
?>
<div>

  <?=$mysql_array['views'] ?> have viewed this page!

</div>
        <form name="form1" method="post" action="http://www.yourdomain.com/index.php">
        <table width="100%" border="0">
        <tr> 
        <td class="maintablestyle">
            [b]
            
          Rate This Song ( <?
            $score = $mysql_array['score'];
            $rating = $mysql_array['no_of_ratings'];
            $score_out_of_five = ceil($score/$rating);
            for($i=1;$i<=5;$i++)
            {
                if ($i <= $score_out_of_five)
                {
                echo '[img]/images/star1.gif[/img]';
                }
                else
                {
                echo '[img]/images/star2.gif[/img]';
                }
            }
            ?>)[/b]
            <input name="lyric_id" type="hidden" id="lyric_id" value="<?=$lyric_id; ?>"> 
            <input name="lyric" type="hidden" id="lyric" value="<?=$lyric; ?>">
        </td>
        <td>
            <select name="score" id="score" class="form_select">
<?
            for($i=1;$i<=10;$i++)
            {
            echo "<option value=\"$i\">$i</option>\r\n";
            }
?>
            </select>
        </td>
        <td>
            <input type="submit" name="Submit2" value="Rate" class="form_button" />
        </td>
        </tr>
        </table>
        </form>

<?
        function formatDate($val)
        {
            list($date, $time) = explode(" ", $val);
            list($year, $month, $day) = explode("-", $date);
            list($hour, $minute, $second) = explode (":", $time);
            return date("l, m.j.y @ H:ia", mktime($hour, $minute, $second, $month, $day, $year));
        }
        $db = new mysql;
        $mysql_comment_array = $db->easy_get_rows( "SELECT * FROM comments WHERE comment_lyricid='$lyric_id' ORDER BY comment_date" );
        $num_rows = $db->num_rows();
        if($num_rows >= 1)
        {
        echo "[list]";
            for ($i = 0; $i<$num_rows; $i++)
            {
//                echo "$i";
                echo "[*]".$mysql_comment_array[$i]['comment_name'].":
".$mysql_comment_array[$i]['comment_text']."
";
            }
//            foreach($mysql_comment_array as $row)
//            {
//            echo "[*]".$row['comment_name']."[*]".$row['comment_text']."";
//            }
        echo "[/list]";
        }
        else
        {
            echo 'No comments.';
        }
        if(strlen($mysql_array['youtube']) >= 6)
        {
            $youtube = $mysql_array['youtube'];
        }else
        {
            $youtubesearchquery = str_replace(" ", "+", $lyric[1]." ".$lyric[4]);
            $gg = "http://youtube.com/results?search_query=".$youtubesearchquery."&search=";
            $a = file_get_contents($gg);
            if(preg_match("/<a class=\"newvtitlelink\" href=\"(.*?)\" rel=\"nofollow\"/s", $a,$matches))
            {
                if($matches>0)
                {
                    $b = file_get_contents("http://youtube.com".$matches[1]);
                }
                preg_match("/<input name=\"embed_code\" type=\"text\" value=\'(.*?)\' class=\"vidURLField\"/s", $b,$matches);
                if (count($matches)>0)
                {
                    $youtube=$matches[1];
                    $db->query("UPDATE `lyrics` SET `youtube` = '$youtube' where lyric_id ='$lyric_id'" );
                }
                else 
                {
                    $youtube = "Embedding Disabled";
                }
            }
            else
            {
                $youtube = "No video avaible";
            }
        }
        if (isset($_SESSION["regged"]) && $_SESSION["regged"])
        {
            
        
?>
<div id="submitcomment" class="submitcomment"><form name="submitcomment" method="post" action="http://www.yourdomain.com/submitcomment.php">
  <table width="100%">
    <tr>
    <td><input name="url" class="topinput" id="url" tabindex="3" value="homepage" /></td>
    </tr>
    <tr valign="top">
    <td>
    <textarea tabindex="4" id="message" name="message" rows="10" cols="50" class="form">type your message here</textarea></td>
    </tr>
    <tr>
    <td><input type="submit" name="post" value="Submit Comment" class="form_button" />
</td>
    </tr>
    </table>
    <input type="hidden" name="lyricurl" value="index.php?lyric_id=<?php echo $lyric_id;?>" />
    <input type="hidden" name="lyricid" value="<?php echo $lyric_id;?>" />
    </form>
  </div>
</div>
<?
        }
    }
    if(isset($_REQUEST["do"]) && ($_REQUEST["do"] =="list" )) 
    {
        if(!isset($_REQUEST["start"]))
        {
            $start = 0;
        }
        else
        {
            $start = $_REQUEST["start"];
        }
        $eu = ($start - 0); 
        $limit = 20;
        $this1 = $eu + $limit; 
        $back = $eu - $limit; 
        $next = $eu + $limit; 

        $db = new mysql;
        $db->query( "select approved from lyrics where approved='1'" );
        $nume=$db->num_rows();
?>
        <table class="listing">
        <tr>
        <td>[url="'index.php?do=list&column_name=lyric_id'>Id</a></td>
        <td><a"]Artist[/url]</td>
        <td>[url="'index.php?do=list&column_name=lyric_title'>Title</a></td>
        <td><a"]Score[/url]</td>
        <td><a href='index.php?do=list&column_name=views'>Views</a></td></tr>
<?
        $query = "SELECT * FROM `lyrics` where approved='1'";
        if(isset($_REQUEST["column_name"]) and strlen($_REQUEST["column_name"])>0)
        {
            $query = $query . " order by $_REQUEST[column_name]";
        }
        $query = $query. " limit $eu, $limit ";
        $result = $db->easy_get_rows($query);
        foreach($result as $row)
        {
?>
        <tr>
        <td>[url="index.php?lyric_id=<?=$row['lyric_id']?>"]<?=$row['lyric_id']?>[/url]</td>
        <td>[url="index.php?lyric_id=<?=$row['lyric_id']?>"]<?=$row['lyric_artist']?>[/url]</td>
        <td>[url="index.php?lyric_id=<?=$row['lyric_id']?>"]<?=$row['lyric_title']?>[/url]</td> 
        <td>[url="index.php?lyric_id=<?=$row['lyric_id']?>"]<?=$row['score']?>[/url]</td>
        <td>[url="index.php?lyric_id=<?=$row['lyric_id']?>"]<?=$row['views']?>[/url]</td>
        </tr>
<?
        }
        if (isset($_request["column_name"]) and strlen($_request["column_name"])>0)
        {
            $column_name = $_request["column_name"];
        }
        else
        {
            $column_name = 'lyric_id';
        }
        echo "</table>";
        echo "<table><tr><td>[url="'index.php?do=list&start=0&column_name=$column_name'><font"]First</font>[/url]</td><td>";
        if($back >=0) 
        { 
            echo "[url="'index.php?do=list&start=$back&column_name=$column_name'><font"]<< previous</font>[/url]"; 
        } 
        echo "</td><td>";
        $i=0;
        $l=1;
        $maxpage = ceil($nume/$limit);
        $page = ceil($eu/$limit)+1;
        echo "Page $page of $maxpage";

//        for($i=0;$i < $maxpage;$i=$i+$limit)
//        {
//            if($i <> $eu)
//            {
//            echo " <a href='index.php?do=list&start=$i&column_name=$column_name'>$l</a> ";
//            }
//            else
//            {
//                echo "$l";
//            }
//            $l=$l+1;
//        }

        echo "</td><td>";
        if($this1 < $nume)
        { 
            echo "[url="'index.php?do=list&start=$next&column_name=$column_name'><font"]next >></font>[/url]";
        } 
        $laststart = $nume-$limit;
        echo "</td><td>[url="'index.php?do=list&start=$laststart&column_name=$column_name'><font"]Last</font>[/url]</td></tr></table>";
    }
}
include 'template.php';
?>
laro696 Developer · 205 posts #5

here's template.php

<?php
$time_start = microtime(true);
include_once "session.php";
include_once "admin/config.php";
include_once "mysql.class.php";
$db = new mysql();
$config = getConfig();
$sessionId = session_id();
//echo $sessionId;
//echo session_is_registered('online');
//echo session_is_registered('user_id');

if(isset($_REQUEST["lyric_id"]))
{
    $sorgu = $_REQUEST["lyric_id"];
    if(ereg("OR ",$sorgu) || ereg("INSERT",$sorgu) || ereg("DELETE",$sorgu) || ereg("SELECT",$sorgu) || ereg("DROP",$sorgu) || ereg("TRUNCATE",$sorgu))
        die("TRYING TO HACK ME!!!");
}

$lyric_str="";
if(isset($_REQUEST["lyric_id"]) && ($_REQUEST["lyric_id"] != 0 ))
{
    $my_lyric_id = $_REQUEST["lyric_id"];
    $my_lyric_str = " `lyric_id` = ".$my_lyric_id;
    $my_mysql_array = $db->easy_get_row("SELECT * FROM `lyrics` WHERE $my_lyric_str AND `approved` = '1'");
    $my_lyric = $config['site_name'] . " : " . $my_mysql_array['lyric_artist'] . " - " . $my_mysql_array['lyric_title'];
    $my_youtube = $my_mysql_array['youtube'];
}
if(!isset($_REQUEST["lyric_id"]))
{
    $my_lyric = $config['site_name'];
}

if(isset($_REQUEST["youtube_id"])) {
  $user = "orcunyucel";
  $pattern = $my_youtube;
  $file = file_get_contents('http://www.youtube.com/profile?user='.$user);
  preg_match_all('!(watch\?v=[A-Za-z0-9]{11}).*?'.$pattern.'!', $file, $matches, PREG_PATTERN_ORDER);
  $titles = array_unique($matches[1]);

  foreach($titles as $title)
  {
    $page = file_get_contents('http://www.youtube.com/'.$title);
    preg_match('!<title>(.*?)</title>!', $page, $matches);

    $title_text = $matches[1];

    preg_match('!video_id=.*&t=[^\"&]*!', $page, $matches);
    $video = 'http://youtube.com/get_video?'.$matches[0];

    header("Location: $video");
  }
}
if (session_is_registered('user_id'))
{
//    echo "1";
    $db->query( "UPDATE users_online SET activity=now(), member='y' WHERE session_id='$sessionId'" );
}
else if (session_is_registered('online'))
{
//    echo "2";
    $db->query( "UPDATE users_online SET activity=now(), member='n' WHERE session_id='$sessionId'" );
}
else if (!isset($_SESSION['user_id']) && !session_is_registered('online'))
{
//    echo "3";
    $db->query("INSERT INTO users_online (session_id, activity) VALUES ('$sessionId', now())");
    session_register('online');
}

?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<script language="javascript" type="text/javascript">
var win=null;
function NewWindow(mypage,myname,w,h,scroll,pos){
if(pos=="random"){LeftPosition=(screen.availWidth)?Math.floor(Math.random()*(screen.availWidth-w)):50;TopPosition=(screen.availHeight)?Math.floor(Math.random()*((screen.availHeight-h)-75)):50;}
if(pos=="center"){LeftPosition=(screen.availWidth)?(screen.availWidth-w)/2:50;TopPosition=(screen.availHeight)?(screen.availHeight-h)/2:50;}
if(pos=="default"){LeftPosition=50;TopPosition=50}
else if((pos!="center" && pos!="random" && pos!="default") || pos==null){LeftPosition=0;TopPosition=20}
settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no';
win=window.open(mypage,myname,settings);
if(win.focus){win.focus();}}
function CloseNewWin(){if(win!=null && win.open)win.close()}
window.onfocus=CloseNewWin;
// -->
</script>
<title><?=$my_lyric?></title>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8'>
<link href="http://www.yourdomain.com/style.css" type="text/css" rel="stylesheet">
<script src="http://www.yourdomain.com/javascript.js" type="text/javascript"></script>
</head>
<body>
    <div id="headerNavigation">
    <div id="headerNavigationLeft">
        [url="http://www.yourdomain.com/faq.php"]FAQ[/url]| [url="http://www.yourdomain.com/searchform.php"]Advanced Search[/url] | [url="http://www.yourdomain.com/contactus.php"]Contact us[/url]    </div>
    <?php
    if (isset($_SESSION["user_id"]) && isset($_SESSION["username"]))
    {
    echo '<div id="headerNavigationRight">';
    echo '[url="http://www.yourdomain.com/changepassword.php"]Change Password[/url][url="http://www.yourdomain.com/submitlyric.php"]Submit a lyric[/url]';
    $userId = $_SESSION["user_id"];
    $mysql_array = $db->easy_get_row("SELECT email_addr FROM members WHERE member_id='$userId'");
    $email_addr = $mysql_array['email_addr'];
    $subsbriber = checkIfSubscribed($email_addr);
        if ($subsbriber != "0")
        {
            echo '[url="www://www.yourdomain.com/subscribe.php?subscribe=no&email_id='.$email_addr.'"]Unsubscribe[/url]';
        }
        else
        {
            echo '[url="http://www.yourdomain.com/subscribe.php?subscribe=yes&email_id='.$email_addr.'"]Subscribe[/url]';
        }
    echo '[url="http://www.yourdomain.com/logout.php"]Logout[/url]</div>';
    }
    else
    {
?>
        <div id="headerNavigationRightForm">
        <form action="http://www.yourdomain.com/login.php" id="login_form" onsubmit="return validate();">
        [url="http://www.yourdomain.com/signup.php"]Register[/url]
        | [url="http://www.yourdomain.com/forgotpassword.php"]Forgotten Password?[/url]
        <input type="text" name="username" id="username" value="" class="topinput" />
        <input type="password" name="userpassword" id="userpassword" value="" class="topinput" />
        <input type="submit" class="topsubmit" value="" />
        </form>
        </div>
<?
    }
?>
    </div>
    <div class="topdiv">
    <table cellpadding="0" cellspacing="0" style="width:100%; border:none;">
    <tr>
    <td style="width:31%;">
    [url="http://www.yourdomain.com/index.php"][img]http://www.yourdomain.com/images/main_logo.jpg[/img][/url]
    </td>
    <td style="width:69%;">
<?
    $mysql_array = $db->easy_get_row( "SELECT * FROM ads WHERE ad_active='yes' and ad_position='2' ORDER BY RAND() LIMIT 0,1" );
    echo $mysql_array['ad_text'];
?> 
    </td>
    </tr>
    </table>
    </div>
    
    <div class="topdiv">
    <div id="topNavigation">
    [list]
    [*][url="http://www.yourdomain.com/index.php"][img]http://www.yourdomain.com/images/home.jpg[/img][/url][url="http://www.yourdomain.com/list.html"][img]http://www.yourdomain.com/images/lyrics.jpg[/img][/url][url="http://www.yourdomain.com/submitlyric.php"][img]http://www.yourdomain.com/images/submit.jpg[/img][/url][url="http://www.yourdomain.com/requestlyric.php"][img]http://www.yourdomain.com/images/request.jpg[/img][/url][url="#"][img]http://www.yourdomain.com/images/forum.jpg[/img][/url]
    [/list]
    </div>
<?php
    if(isset($_REQUEST["msg"]) && $_REQUEST['msg'] != "")
    {
        echo '<div id="msg">'.$_REQUEST['msg']."</div>";
    }
    echo '<div id="abc">[list]';
        for ($i = 65; $i <= 90; $i++)
        {
            $x = chr($i);
            echo "<li onmouseover=\"this.style.backgroundColor='#C7F241';\" onmouseout=\"this.style.backgroundColor='#1e1e1e';\"><a href=\"http://www.yourdomain.com/search/".$x.".html\">".$x."</a>";
        }
?>
    [/list]
    </div>
    </div>
    
    <div id="container">
    <table border="0" cellpadding="0" cellspacing="0">
      
    <tr>
    <td width="120" height="600" valign="top" style="width:120px;">
      <?php
    $mysql_array = $db->easy_get_row( "SELECT * FROM ads WHERE ad_active='yes' and ad_position='1' ORDER BY RAND() LIMIT 0,1" );
    echo $mysql_array['ad_text'];
?>    </td>
    <td rowspan="2" valign="top">
        <div id="containerLeft">
        <? main(); ?>
        </div>    </td>
    
    <td rowspan="2" valign="top">
        <div id="containerRight">
          <div>
<?php
        if (!empty($youtube))
        {
?>
                [img]http://www.yourdomain.com/images/video.jpg[/img]
                <div style="clear:both; width: 290px; height: 235px; border: 2px solid #92b527;">
                    <div class="youtube_resizer" style="text-align:center;">
<?php
                    $ids = explode('|', file_get_contents('frontpage.cache'));
                    foreach($ids as $id)
                    {
                    $rows[] = $db->easy_get_row('SELECT * FROM `lyrics` WHERE `lyric_id` = '.$id);
                    }
                    $youtube = str_replace(' width="425" height="350"', ' width="290" height="235"', $youtube);
                    echo $youtube;
?>
                </div>
            </div>
            [img]http://www.yourdomain.com/images/bottom.jpg[/img]
<?php 

        if($youtube == "No video avaible" || $youtube == "Embedding Disabled")
        {
        }
        else
        {
        $my_youtube_url = (strip_tags($my_youtube, '<embed>'));
        $unneeded = array('<embed src="','" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed>');
        $onlyconsonants = str_replace($unneeded, "", $my_youtube_url);
        $my_youtube_url_array = explode("/", $onlyconsonants);
        require_once("youtube.php");
        error_reporting(0);
        ini_set("max_execution_time",0);
        $my_youtube_link = "http://www.youtube.com/watch.php?v=" . $my_youtube_url_array['4'];

        if($my_cek = download_youtube($my_youtube_link)){
            $my_link = $my_cek;
?>
        <div align="center">[url="<?php echo $my_link; ?>"][img]http://www.yourdomain.com/images/download.jpg[/img][/url][url="http://www.yourdomain.com/convert.php"][img]http://www.yourdomain.com/images/convert.gif[/img][/url]

</div>
<?php
        }

        } 

        }
?>
         </div>
            <div>
            [img]http://www.yourdomain.com/images/search.jpg[/img]
            <div style="padding:10px 0px 0px 0px; margin:0px; text-align:center;">
            <form id="" method="post" action="http://www.yourdomain.com/searchresult.php">
            <input type="text" name="keyword" id="keyword" class="topinput" style="width: 120px;">
            <select name="for" class="form_select">
            <option value="2">Artists</option>
            <option value="1">Song Tittle</option>
            </select>
            <input type="submit" name="Submit" class="form_button" value="Search" />
            </form>
            </div>
            [img]http://www.yourdomain.com/images/bottom.jpg[/img]        </div>
        <div>
<?
        if(empty($youtube))
        {
?>
            [img]http://www.yourdomain.com/images/videos.jpg[/img]
            <div style="clear: both; width: 290px; height: 235px; border: 2px solid #92b527">
                <div class="youtube_resizer style=text-align:center;">
<?
/*                $ids = explode('|', file_get_contents('frontpage.cache'));
                foreach($ids as $id)
                {
                $abc = $db->easy_get_row('SELECT * FROM `lyrics` WHERE `lyric_id` = '.$id);
                    if($abc['youtube'] != "" && (!isset($ytv)))
                    {
                        $ytv = $abc['youtube'];
                    }
                $rows[] = $abc;
                }
 */
                $abc = $db->easy_get_row('SELECT youtube FROM `lyrics` WHERE `approved` = 1 AND youtube != "" ORDER BY `lyric_id` DESC LIMIT 0,1');
                $ytv = $abc['youtube'];
                $bodytag = str_replace(' width="425" height="350"', ' width="290" height="235"', $ytv);
                echo $bodytag;
?>
                </div>
            </div>
            [img]http://www.yourdomain.com/images/bottom.jpg[/img]
<?
        }
?>
        </div>
        <div>
            [img]http://www.yourdomain.com/images/lat_lyrics.jpg[/img]
            <table style="width:296px; border:none;" cellpadding="0" cellspacing="0">
            <tbody class="lyrics">

<?
            $rows = $db->easy_get_rows( "select lyric_id, lyric_artist, lyric_title from lyrics WHERE approved='1' order by lyric_id desc LIMIT 10" );
            foreach($rows as $mysql_array)
            {
?>
            <tr> 
            <td style="background-color:#010101;">
            [url="http://www.yourdomain.com/<?php echo preg_replace('/([^a-zA-Z0-9]+)/', '-', $mysql_array["]">[b]<?=$mysql_array["lyric_artist"]?>[/b] - <?=$mysql_array["lyric_title"]?>[/url]</td>
            </tr>
<?
            }
?>
            </tbody>
            </table>
            [img]http://www.yourdomain.com/images/bottom.jpg[/img]        </div>
        <div>
            [img]http://www.yourdomain.com/images/lat_members.jpg[/img]
<?
            $array = $db->easy_get_rows( "select member_id, user_name from members order by member_id desc LIMIT 5" );
            $num_rows = $db->num_rows();
            if($num_rows >= 1)
            {
                foreach($array as $mysql_array)
                {
?>
                <table style="width:296px; border:none;" cellpadding="0px" cellspacing="0px" class="members">
                <tr>
                <td style="background-color:#010101;"><?=$mysql_array["user_name"]?></td>
                </tr>
                </table>
<?
                }
            }
            else
            {
                echo 'No members in database.';
            }
?>
            [img]http://www.yourdomain.com/images/bottom.jpg[/img]        </div>
    </div>    </td>
    <td width="120" valign="top" style="width:120px;">
      <?
    $mysql_array = $db->easy_get_row( "SELECT * FROM ads WHERE ad_active='yes' and ad_position='3' ORDER BY RAND() LIMIT 0,1" );
    echo $mysql_array['ad_text'];
?>    </td>
    </tr>

    </table>
    </div>
    <div style="background-color: #8ca63b; border-top: 1px solid #c6f241; border-bottom: 1px solid #c6f241;">
        <div id="footerNavigation">
        <table style="width:745px; text-align:center; border:none; background:#8ca63b;" cellpadding="0px" cellspacing="0px">
        <tr>
        <td style="width:149px; padding-top: 10px; text-align:center;">
            <table style="width:140px; border:none;" cellpadding="0px" cellspacing="0px">
            <tbody class="bottomtab">
            <tr>
            <th>Navigation</th>
            </tr>
            <tr>
            <td class="bottom_navigation">[url="http://www.yourdomain.com/index.php"]Home[/url]</td>
            </tr>
            <tr>
            <td class="bottom_navigation">[url="http://www.yourdomain.com/list.html"]Lyrics[/url]</td>
            </tr>
            <tr>
            <td class="bottom_navigation">[url="http://www.yourdomain.com/submitlyric.php"]Submit Lyrics[/url]</td>
            </tr>
            <tr>
            <td class="bottom_navigation">[url="http://www.yourdomain.com/requestlyric.php"]Request Lyrics[/url]</td>
            </tr>
            <tr>
            <td class="bottom_navigation">[url=""]Forums[/url]</td>
            </tr>
            </tbody>
            </table>
        </td>
        <td style="width:149px; padding-top:10px; text-align:center; vertical-align:top;">
            <table style="width:140px; border:none;" cellpadding="0px" cellspacing="0px">
<?php
$db->query("SELECT SQL_CALC_FOUND_ROWS `approved` FROM `lyrics` WHERE `approved` = 1 LIMIT 0,1");
$approved = $db->easy_get_row('SELECT FOUND_ROWS();');
$lyrics_count = $approved[0];

$db->query("SELECT SQL_CALC_FOUND_ROWS `approved` FROM `lyrics` WHERE `approved` = 0 LIMIT 0,1");
$approved = $db->easy_get_row('SELECT FOUND_ROWS();');
$lyrics_count_unapproved = $approved[0];

$db->query("SELECT SQL_CALC_FOUND_ROWS `member_id` FROM `members` LIMIT 0,1");
$abcde = $db->easy_get_row('SELECT FOUND_ROWS();');
$members_count = $abcde[0];
?>
            <tbody class="bottomtab">
            <tr>
            <th>Stats</th>
            </tr>
            <tr>
            <td><?="Total lyrics: ".$lyrics_count."
"?></td>
            </tr>
            <tr>
            <td><?="Unapproved lyrics: ".$lyrics_count_unapproved; ?></td>
            </tr>
            <tr>
            <td style="border:none;"><?php echo "Total members: $members_count
"; ?></td>
            </tr>
            </tbody>
            </table>
        </td>
        <td style="width:149px; padding-top: 10px; text-align:center; vertical-align:top;">
            <table style="width:140px; border:none;" cellpadding="0px" cellspacing="0px">
<?php
$limit_time = time() - 300;
//echo $limit_time;
$db->query( "SELECT member FROM users_online WHERE UNIX_TIMESTAMP(activity) >= $limit_time AND member='n'" );
$visits = $db->num_rows();

$db->query( "SELECT member FROM users_online WHERE UNIX_TIMESTAMP(activity) >= $limit_time AND member='y'" );
$members = $db->num_rows();
?>
            <tbody class="bottomtab">
            <tr>
            <th>Users online</th>
            </tr>
            <tr>
            <td>Guests Online: <?=$visits?>
</td>
            </tr>
            <tr>
            <td style="border:none;">Members Online: <?=$members?>
</td>
            </tr>
            </tbody>
            </table>
        </td>
        <td></td>
        </tr>
        <tr>
        <td colspan="5"></td>
        </tr>
        </table>
        </div>
    </div>
    <div style="background-color: #303a12; height: 25px;">
        <div class="topdiv">
            <div class="topleft" style="color:#707f42;">
            Powered by: Lyricing, 2007© |  | RSS            </div>
            <div class="topright" style="margin-top:5px; color:#707f42;">
            Page generated in <?$time_end = microtime(); $time = $time_end - $time_start; echo $time;?>
            seconds  </div>
        </div>
    </div>
</body>
</html>
WhiteWarrior Principal · 1,419 posts #6
<?php
$time_start = microtime(true);
include_once "session.php";
include_once "admin/config.php";
include_once "mysql.class.php";
$db = new mysql();
$config = getConfig();
$sessionId = session_id();
//echo $sessionId;
//echo session_is_registered('online');
//echo session_is_registered('user_id');

if(isset($_REQUEST["lyric_id"]))
{
    $sorgu = $_REQUEST["lyric_id"];
    if(ereg("OR ",$sorgu) || ereg("INSERT",$sorgu) || ereg("DELETE",$sorgu) || ereg("SELECT",$sorgu) || ereg("DROP",$sorgu) || ereg("TRUNCATE",$sorgu))
        die("TRYING TO HACK ME!!!");
}

$lyric_str="";
if(isset($_REQUEST["lyric_id"]) && ($_REQUEST["lyric_id"] != 0 ))
{
    $my_lyric_id = $_REQUEST["lyric_id"];
    $my_lyric_str = " `lyric_id` = ".$my_lyric_id;
    $my_mysql_array = $db->easy_get_row("SELECT * FROM `lyrics` WHERE $my_lyric_str AND `approved` = '1'");
    $my_lyric = $config['site_name'] . " : " . $my_mysql_array['lyric_artist'] . " - " . $my_mysql_array['lyric_title'];
    $my_youtube = $my_mysql_array['youtube'];
}
if(!isset($_REQUEST["lyric_id"]))
{
    $my_lyric = $config['site_name'];
}

if(isset($_REQUEST["youtube_id"])) {
  $user = "orcunyucel";
  $pattern = $my_youtube;
  $file = file_get_contents('http://www.youtube.com/profile?user='.$user);
  preg_match_all('!(watch\?v=[A-Za-z0-9]{11}).*?'.$pattern.'!', $file, $matches, PREG_PATTERN_ORDER);
  $titles = array_unique($matches[1]);

  foreach($titles as $title)
  {
    $page = file_get_contents('http://www.youtube.com/'.$title);
    preg_match('!<title>(.*?)</title>!', $page, $matches);

    $title_text = $matches[1];

    preg_match('!video_id=.*&t=[^\"&]*!', $page, $matches);
    $video = 'http://youtube.com/get_video?'.$matches[0];

    header("Location: $video");
  }
}
if (session_is_registered('user_id'))
{
//    echo "1";
    $db->query( "UPDATE users_online SET activity=now(), member='y' WHERE session_id='$sessionId'" );
}
else if (session_is_registered('online'))
{
//    echo "2";
    $db->query( "UPDATE users_online SET activity=now(), member='n' WHERE session_id='$sessionId'" );
}
else if (!isset($_SESSION['user_id']) && !session_is_registered('online'))
{
//    echo "3";
    $db->query("INSERT INTO users_online (session_id, activity) VALUES ('$sessionId', now())");
    session_register('online');
}

?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<script language="javascript" type="text/javascript">
var win=null;
function NewWindow(mypage,myname,w,h,scroll,pos){
if(pos=="random"){LeftPosition=(screen.availWidth)?Math.floor(Math.random()*(screen.availWidth-w)):50;TopPosition=(screen.availHeight)?Math.floor(Math.random()*((screen.availHeight-h)-75)):50;}
if(pos=="center"){LeftPosition=(screen.availWidth)?(screen.availWidth-w)/2:50;TopPosition=(screen.availHeight)?(screen.availHeight-h)/2:50;}
if(pos=="default"){LeftPosition=50;TopPosition=50}
else if((pos!="center" && pos!="random" && pos!="default") || pos==null){LeftPosition=0;TopPosition=20}
settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no';
win=window.open(mypage,myname,settings);
if(win.focus){win.focus();}}
function CloseNewWin(){if(win!=null && win.open)win.close()}
window.onfocus=CloseNewWin;
// -->
</script>
<title><?=$my_lyric?></title>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8'>
<link href="http://www.yourdomain.com/style.css" type="text/css" rel="stylesheet">
<script src="http://www.yourdomain.com/javascript.js" type="text/javascript"></script>
</head>
<body>
    <div id="headerNavigation">
    <div id="headerNavigationLeft">
        [url="http://www.yourdomain.com/faq.php"]FAQ[/url]| [url="http://www.yourdomain.com/searchform.php"]Advanced Search[/url] | [url="http://www.yourdomain.com/contactus.php"]Contact us[/url]    </div>
    <?php
    if (isset($_SESSION["user_id"]) && isset($_SESSION["username"]))
    {
    echo '<div id="headerNavigationRight">';
    echo '[url="http://www.yourdomain.com/changepassword.php"]Change Password[/url][url="http://www.yourdomain.com/submitlyric.php"]Submit a lyric[/url]';
    $userId = $_SESSION["user_id"];
    $mysql_array = $db->easy_get_row("SELECT email_addr FROM members WHERE member_id='$userId'");
    $email_addr = $mysql_array['email_addr'];
    $subsbriber = checkIfSubscribed($email_addr);
        if ($subsbriber != "0")
        {
            echo '[url="www://www.yourdomain.com/subscribe.php?subscribe=no&email_id='.$email_addr.'"]Unsubscribe[/url]';
        }
        else
        {
            echo '[url="http://www.yourdomain.com/subscribe.php?subscribe=yes&email_id='.$email_addr.'"]Subscribe[/url]';
        }
    echo '[url="http://www.yourdomain.com/logout.php"]Logout[/url]</div>';
    }
    else
    {
?>
        <div id="headerNavigationRightForm">
        <form action="http://www.yourdomain.com/login.php" id="login_form" onsubmit="return validate();">
        [url="http://www.yourdomain.com/signup.php"]Register[/url]
        | [url="http://www.yourdomain.com/forgotpassword.php"]Forgotten Password?[/url]
        <input type="text" name="username" id="username" value="" class="topinput" />
        <input type="password" name="userpassword" id="userpassword" value="" class="topinput" />
        <input type="submit" class="topsubmit" value="" />
        </form>
        </div>
<?
    }
?>
    </div>
    <div class="topdiv">
    <table cellpadding="0" cellspacing="0" style="width:100%; border:none;">
    <tr>
    <td style="width:31%;">
    [url="http://www.yourdomain.com/index.php"][img]http://www.yourdomain.com/images/main_logo.jpg[/img][/url]
    </td>
    <td style="width:69%;">
<?
    $mysql_array = $db->easy_get_row( "SELECT * FROM ads WHERE ad_active='yes' and ad_position='2' ORDER BY RAND() LIMIT 0,1" );
    echo $mysql_array['ad_text'];
?>
    </td>
    </tr>
    </table>
    </div>
    
    <div class="topdiv">
    <div id="topNavigation">
    [list]
    [*][url="http://www.yourdomain.com/index.php"][img]http://www.yourdomain.com/images/home.jpg[/img][/url][url="http://www.yourdomain.com/list.html"][img]http://www.yourdomain.com/images/lyrics.jpg[/img][/url][url="http://www.yourdomain.com/submitlyric.php"][img]http://www.yourdomain.com/images/submit.jpg[/img][/url][url="http://www.yourdomain.com/requestlyric.php"][img]http://www.yourdomain.com/images/request.jpg[/img][/url][url="#"][img]http://www.yourdomain.com/images/forum.jpg[/img][/url]
    [/list]
    </div>
<?php
    if(isset($_REQUEST["msg"]) && $_REQUEST['msg'] != "")
    {
        echo '<div id="msg">'.$_REQUEST['msg']."</div>";
    }
    echo '<div id="abc">[list]';
        for ($i = 65; $i <= 90; $i++)
        {
            $x = chr($i);
            echo "<li onmouseover=\"this.style.backgroundColor='#C7F241';\" onmouseout=\"this.style.backgroundColor='#1e1e1e';\"><a href=\"http://www.yourdomain.com/search/".$x.".html\">".$x."</a>";
        }
?>
    [/list]
    </div>
    </div>
    
    <div id="container">
    <table border="0" cellpadding="0" cellspacing="0">
      
    <tr>
    <td width="120" height="600" valign="top" style="width:120px;">
      <?php
    $mysql_array = $db->easy_get_row( "SELECT * FROM ads WHERE ad_active='yes' and ad_position='1' ORDER BY RAND() LIMIT 0,1" );
    echo $mysql_array['ad_text'];
?>    </td>
    <td rowspan="2" valign="top">
        <div id="containerLeft">
        <? main(); ?>
        </div>    </td>
    
    <td rowspan="2" valign="top">
        <div id="containerRight">
          <div>
<?php
        if (!empty($youtube))
        {
?>
                [img]http://www.yourdomain.com/images/video.jpg[/img]
                <div style="clear:both; width: 290px; height: 235px; border: 2px solid #92b527;">
                    <div class="youtube_resizer" style="text-align:center;">
<?php
                    $ids = explode('|', file_get_contents('frontpage.cache'));
                    foreach($ids as $id)
                    {
                    $rows[] = $db->easy_get_row('SELECT * FROM `lyrics` WHERE `lyric_id` = '.$id);
                    }
                    $youtube = str_replace(' width="425" height="350"', ' width="290" height="235"', $youtube);
                    echo $youtube;
?>
                </div>
            </div>
            [img]http://www.yourdomain.com/images/bottom.jpg[/img]
<?php

        if($youtube == "No video avaible" || $youtube == "Embedding Disabled")
        {
        }
        else
        {
        $my_youtube_url = (strip_tags($my_youtube, '<embed>'));
        $unneeded = array('<embed src="','" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed>');
        $onlyconsonants = str_replace($unneeded, "", $my_youtube_url);
        $my_youtube_url_array = explode("/", $onlyconsonants);
        require_once("youtube.php");
        error_reporting(0);
        ini_set("max_execution_time",0);
        $my_youtube_link = "http://www.youtube.com/watch.php?v=" . $my_youtube_url_array['4'];

        if($my_cek = download_youtube($my_youtube_link)){
            $my_link = $my_cek;
?>
        <div align="center">[url="<?php echo $my_link; ?>"][img]http://www.yourdomain.com/images/download.jpg[/img][/url][url="http://www.yourdomain.com/convert.php"][img]http://www.yourdomain.com/images/convert.gif[/img][/url]

</div>
<?php
        }

        }

        }
?>
         </div>
            <div>
            [img]http://www.yourdomain.com/images/search.jpg[/img]
            <div style="padding:10px 0px 0px 0px; margin:0px; text-align:center;">
            <form id="" method="post" action="http://www.yourdomain.com/searchresult.php">
            <input type="text" name="keyword" id="keyword" class="topinput" style="width: 120px;">
            <select name="for" class="form_select">
            <option value="2">Artists</option>
            <option value="1">Song Tittle</option>
            </select>
            <input type="submit" name="Submit" class="form_button" value="Search" />
            </form>
            </div>
            [img]http://www.yourdomain.com/images/bottom.jpg[/img]        </div>
        <div>
<?
        if(empty($youtube))
        {
?>
            [img]http://www.yourdomain.com/images/videos.jpg[/img]
            <div style="clear: both; width: 290px; height: 235px; border: 2px solid #92b527">
                <div class="youtube_resizer style=text-align:center;">
<?
/*                $ids = explode('|', file_get_contents('frontpage.cache'));
                foreach($ids as $id)
                {
                $abc = $db->easy_get_row('SELECT * FROM `lyrics` WHERE `lyric_id` = '.$id);
                    if($abc['youtube'] != "" && (!isset($ytv)))
                    {
                        $ytv = $abc['youtube'];
                    }
                $rows[] = $abc;
                }
*/
                $abc = $db->easy_get_row('SELECT youtube FROM `lyrics` WHERE `approved` = 1 AND youtube != "" ORDER BY `lyric_id` DESC LIMIT 0,1');
                $ytv = $abc['youtube'];
                $bodytag = str_replace(' width="425" height="350"', ' width="290" height="235"', $ytv);
                echo $bodytag;
?>
                </div>
            </div>
            [img]http://www.yourdomain.com/images/bottom.jpg[/img]
<?
        }
?>
        </div>
        <div>
            [img]http://www.yourdomain.com/images/lat_lyrics.jpg[/img]
            <table style="width:296px; border:none;" cellpadding="0" cellspacing="0">
            <tbody class="lyrics">

<?
            $rows = $db->easy_get_rows( "select lyric_id, lyric_artist, lyric_title from lyrics WHERE approved='1' order by lyric_id desc LIMIT 10" );
            foreach($rows as $mysql_array)
            {
?>
            <tr>
            <td style="background-color:#010101;">
            [url="http://www.yourdomain.com/<?php echo preg_replace('/([^a-zA-Z0-9]+)/', '-', $mysql_array["]">[b]<?=$mysql_array["lyric_artist"]?>[/b] - <?=$mysql_array["lyric_title"]?>[/url]</td>
            </tr>
<?
            }
?>
            </tbody>
            </table>
            [img]http://www.yourdomain.com/images/bottom.jpg[/img]        </div>
        <div>
            [img]http://www.yourdomain.com/images/lat_members.jpg[/img]
<?
            $array = $db->easy_get_rows( "select member_id, user_name from members order by member_id desc LIMIT 5" );
            $num_rows = $db->num_rows();
            if($num_rows >= 1)
            {
                foreach($array as $mysql_array)
                {
?>
                <table style="width:296px; border:none;" cellpadding="0px" cellspacing="0px" class="members">
                <tr>
                <td style="background-color:#010101;"><?=$mysql_array["user_name"]?></td>
                </tr>
                </table>
<?
                }
            }
            else
            {
                echo 'No members in database.';
            }
?>
            [img]http://www.yourdomain.com/images/bottom.jpg[/img]        </div>
    </div>    </td>
    <td width="120" valign="top" style="width:120px;">
      <?
    $mysql_array = $db->easy_get_row( "SELECT * FROM ads WHERE ad_active='yes' and ad_position='3' ORDER BY RAND() LIMIT 0,1" );
    echo $mysql_array['ad_text'];
    ?>
    </td>
    </tr>

    </table>
    </div>
    <div style="background-color: #8ca63b; border-top: 1px solid #c6f241; border-bottom: 1px solid #c6f241;">
        <div id="footerNavigation">
        <table style="width:745px; text-align:center; border:none; background:#8ca63b;" cellpadding="0px" cellspacing="0px">
        <tr>
        <td style="width:149px; padding-top: 10px; text-align:center;">
            <table style="width:140px; border:none;" cellpadding="0px" cellspacing="0px">
            <tbody class="bottomtab">
            <tr>
            <th>Navigation</th>
            </tr>
            <tr>
            <td class="bottom_navigation">[url="http://www.yourdomain.com/index.php"]Home[/url]</td>
            </tr>
            <tr>
            <td class="bottom_navigation">[url="http://www.yourdomain.com/list.html"]Lyrics[/url]</td>
            </tr>
            <tr>
            <td class="bottom_navigation">[url="http://www.yourdomain.com/submitlyric.php"]Submit Lyrics[/url]</td>
            </tr>
            <tr>
            <td class="bottom_navigation">[url="http://www.yourdomain.com/requestlyric.php"]Request Lyrics[/url]</td>
            </tr>
            <tr>
            <td class="bottom_navigation">[url=""]Forums[/url]</td>
            </tr>
            </tbody>
            </table>
        </td>
        <td style="width:149px; padding-top:10px; text-align:center; vertical-align:top;">
            <table style="width:140px; border:none;" cellpadding="0px" cellspacing="0px">
       <?php     
$db->query("SELECT SQL_CALC_FOUND_ROWS `approved` FROM `lyrics` WHERE `approved` = 1 LIMIT 0,1");
$approved = $db->easy_get_row('SELECT FOUND_ROWS();');
$lyrics_count = $approved[0];

$db->query("SELECT SQL_CALC_FOUND_ROWS `approved` FROM `lyrics` WHERE `approved` = 0 LIMIT 0,1");
$approved = $db->easy_get_row('SELECT FOUND_ROWS();');
$lyrics_count_unapproved = $approved[0];

$db->query("SELECT SQL_CALC_FOUND_ROWS `member_id` FROM `members` LIMIT 0,1");
$abcde = $db->easy_get_row('SELECT FOUND_ROWS();');
$members_count = $abcde[0];
?>
            <tbody class="bottomtab">
            <tr>
            <th>Stats</th>
            </tr>
            <tr>
            <td><?="Total lyrics: ".$lyrics_count."
"?></td>
            </tr>
            <tr>
            <td><?="Unapproved lyrics: ".$lyrics_count_unapproved; ?></td>
            </tr>
            <tr>
            <td style="border:none;"><?php echo "Total members: $members_count
"; ?></td>
            </tr>
            </tbody>
            </table>
        </td>
        <td style="width:149px; padding-top: 10px; text-align:center; vertical-align:top;">
            <table style="width:140px; border:none;" cellpadding="0px" cellspacing="0px">
<?php
$limit_time = time() - 300;
//echo $limit_time;
$db->query( "SELECT member FROM users_online WHERE UNIX_TIMESTAMP(activity) >= $limit_time AND member='n'" );
$visits = $db->num_rows();

$db->query( "SELECT member FROM users_online WHERE UNIX_TIMESTAMP(activity) >= $limit_time AND member='y'" );
$members = $db->num_rows();
?>
            <tbody class="bottomtab">
            <tr>
            <th>Users online</th>
            </tr>
            <tr>
            <td>Guests Online: <?=$visits?>
</td>
            </tr>
            <tr>
            <td style="border:none;">Members Online: <?=$members?>
</td>
            </tr>
            </tbody>
            </table>
        </td>
        <td></td>
        </tr>
        <tr>
        <td colspan="5"></td>
        </tr>
        </table>
        </div>
    </div>
    <div style="background-color: #303a12; height: 25px;">
        <div class="topdiv">
            <div class="topleft" style="color:#707f42;">
            Powered by: Lyricing, 2007© |  | RSS            </div>
            <div class="topright" style="margin-top:5px; color:#707f42;">
            Page generated in <?$time_end = microtime(); $time = $time_end - $time_start; echo $time;?>
            seconds  </div>
        </div>
    </div>
</body>
</html>

That should work now, not 100% sure

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close