"; //echo "B=".$b."
"; $q_id = $_REQUEST['id']; $top = "SELECT * FROM `quotes` WHERE `cat_url` = '$a' AND `id` = '$q_id' AND `status` = '0' OR `sub_cat_url` = '$a' AND `id` = '$q_id' AND `status` = '0' OR `ss_cat_url` = '$a' AND `id` = '$q_id' AND `status` = '0'"; $top_result = mysql_query($top) or die('Error, Quote table query failed : ' . mysql_error()); $count_if_ext1 = mysql_num_rows($top_result); if($count_if_ext1 == '0') { header("Location: http://quotes.wishbowl.org/404.html"); } $top_row = mysql_fetch_array($top_result); $c_url = str_replace("_", "-", $top_row['cat_url']); $s_url = str_replace("_", "-", $top_row['sub_cat_url']); $ss_url = str_replace("_", "-", $top_row['ss_cat_url']); $p_id = $top_row['id']; $p_title = $top_row['title']; $p_views = $top_row['views']; $p_voteup = $top_row['voteup']; $p_votedown = $top_row['votedown']; $p_ratings = $top_row['ratings']; $v = $p_views + 1; $n_views = mysql_query("UPDATE `quotes` SET `views`='$v' WHERE id='$q_id' AND `status` = '0'"); $p_description = str_replace("
", "
", $top_row['description']); $p_description = str_replace("
", "
",$p_description); $p_description = str_replace('\"', '"',$p_description); $p_description = str_replace('\"', "'",$p_description); $p_description = str_replace("\'", "'",$p_description); $p_description_fb = str_replace("
", ", ",$p_description); $image_code = str_replace("
", "
", $top_row['image_code']); $image_code = str_replace("
", "
",$image_code); $image_code = str_replace('\"', '"',$image_code); $image_code = str_replace('\"', "'",$image_code); $image_code = str_replace("\'", "'",$image_code); $content = $image_code; $frst_image = preg_match_all( '||i', $content, $matches ); $images_fb = $item['image'] = $matches[ 1 ][ 0 ]; $title_for_meta = $top_row['description']; $title_for_meta = str_replace("
", "
", $title_for_meta); $title_for_meta = str_replace("
", "
",$title_for_meta); $title_for_meta = explode("<", $title_for_meta); $title_for_meta = $title_for_meta[0]; $title_for_meta = explode(" ", $title_for_meta); $title_for_meta = "$title_for_meta[0] $title_for_meta[1] $title_for_meta[2] $title_for_meta[3] $title_for_meta[4] $title_for_meta[5] $title_for_meta[6] $title_for_meta[7]..."; $title_for_meta = str_replace('\"', '"',$title_for_meta); $title_for_meta = str_replace("\'", "'",$title_for_meta); $p_description_meta = str_replace("
", " ",$p_description); $p_description_meta = str_replace('"', "", $p_description_meta); $p_description_meta = substr($p_description_meta, 0, 150); $from_gid = $top_row['id']; if($ss_url != '') { $p_url = 'http://quotes.wishbowl.org/'.$ss_url.'-quote-'.$p_id.'.html'; $cat_url = 'http://quotes.wishbowl.org/'.$ss_url.'-quotes.html'; $n_url = 'http://quotes.wishbowl.org/'.$ss_url.'-quotes.html'; $np = "`cat_url` = '$c_url' AND `sub_cat_url` = '$s_url' AND `ss_cat_url` = '$ss_url'"; $chk_cat_url = $top_row['ss_cat_url']; $cat_name = $top_row['ss_cat_name']; } elseif(($s_url != '') && ($ss_url == '')) { $p_url = 'http://quotes.wishbowl.org/'.$s_url.'-quote-'.$p_id.'.html'; $cat_url = 'http://quotes.wishbowl.org/'.$s_url.'-quotes.html'; $n_url = 'http://quotes.wishbowl.org/'.$s_url.'-quotes.html'; $np = "`cat_url` = '$c_url' AND `sub_cat_url` = '$s_url'"; $chk_cat_url = $top_row['sub_cat_url']; $cat_name = $top_row['sub_cat_name']; } else { $p_url = 'http://quotes.wishbowl.org/'.$c_url.'-quote-'.$p_id.'.html'; $cat_url = 'http://quotes.wishbowl.org/'.$c_url.'-quotes.html'; $n_url = 'http://quotes.wishbowl.org/'.$c_url.'-quotes.html'; $np = "`cat_url` = '$c_url'"; $chk_cat_url = $top_row['cat_url']; $cat_name = $top_row['cat_name']; } $p_author_id = $top_row['author_id']; $p_sql = "SELECT * FROM `author` WHERE `id` = '$p_author_id'"; $p_result = mysql_query($p_sql) or die('Error, Author table query failed : ' . mysql_error()); $p_list = mysql_fetch_array($p_result); $p_author_name = $p_list['author_name']; $p_thumb_name = $p_list['thumb_name']; $p_image_url = 'http://quotes.wishbowl.org/author/'.$p_list[thumb_name]; $p_author_url = 'http://quotes.wishbowl.org/author-'.str_replace("_", "-", $p_list[author_url]).'.html'; $expected_url = "http://quotes.wishbowl.org/$chk_cat_url-quote-$p_id.html"; $url_path_get = "http://".$_SERVER['HTTP_HOST']."/$_REQUEST[cat]-quote-$_REQUEST[id].html"; if($expected_url != $url_path_get){ header("Location: http://quotes.wishbowl.org/404.html"); } //echo "ELK = ".$expected_url."
"; //echo "LK = ".$url_path_get."
"; $nxt = "SELECT * FROM `quotes` WHERE `id` > '$q_id' AND $np AND `status` = '0' ORDER BY `id` ASC LIMIT 0,1"; $r_nxt = mysql_query($nxt) or die('Error, query failed ' . mysql_error()); if (mysql_num_rows($r_nxt) == 0) { $nxtr = $n_url; }else { while($row_next = mysql_fetch_array($r_nxt)) { $nxtr = 'http://quotes.wishbowl.org/'.$chk_cat_url.'-quote-'.$row_next[id].'.html'; } } $pre = "SELECT `id` FROM `quotes` WHERE `id` < '$q_id' AND $np AND `status` = '0' ORDER BY `id` DESC LIMIT 0,1"; $r_pre = mysql_query($pre) or die('Error, query failed ' . mysql_error()); if (mysql_num_rows($r_pre) == 0) { $prer = $n_url; }else { while($row_pre = mysql_fetch_array($r_pre)) { $prer = 'http://quotes.wishbowl.org/'.$chk_cat_url.'-quote-'.$row_pre[id].'.html'; } } //Connect to main database //include 'opendb-main.php'; //$queryu = "SELECT * FROM `users` WHERE `username` = '$username'"; //$resultu = mysql_query($queryu) or die('Error, Select query failed of users table :'); //$rowu = mysql_fetch_array($resultu); //$user_id = $rowu['id']; //$pts = $rowu['pts']; //if(isset($_SESSION['userpts'.$from_gid])) //{}else{ //$ptsc = $pts + 2; //$tquery = "UPDATE `users` SET `pts` = '$ptsc' WHERE `username` = '$username'"; //$tresult = mysql_query($tquery) or die('Error, query failed ' . mysql_error()); //} //$_SESSION['userpts'.$from_gid] = 'pt'.$from_gid; //--------------------------------------------------------------- $p_id_com = "quote_$p_id"; $p_sql_com = "SELECT * FROM `user_comments` WHERE `from_id` = '$p_id_com' AND `approved` = '1'"; $p_result_com = mysql_query($p_sql_com) or die('Error, Author table query failed : ' . mysql_error()); $cunt = mysql_num_rows($p_result_com); if($cunt != '0'){ $cunts = " ($cunt)"; }else{ $cunts = ''; } ?> <?=$title_for_meta;?>
Quotes
'.$image_code.'

'; } ?>
-
",$p_description); $title_fav0 = $wordChunks[0]; $title_fav = $title_fav0; $wordChunks_n = explode(" ",$title_fav); $new_title = "$wordChunks_n[0] $wordChunks_n[1] $wordChunks_n[2] $wordChunks_n[3] $wordChunks_n[4]"; $title_fav = $new_title; $s="SELECT * FROM `user_fav` WHERE `username` = '$username' AND `fav_id` = '$p_id' AND `f_cod` = '$cod'"; $r = mysql_query($s) or die('Error, Query failed : ' . mysql_error()); if(mysql_num_rows($r) == 0){ if($_COOKIE['member_wish'] !=''){ ?>
Add to Fav
|
Add to Fav
|
Add to Fav
|
|
|
Views :

Comments []

Leave Your Comments


[100 Words Limit]
Your Name
Email Address

Your email will not be displayed


Enter Security code