$value) { if (!$_POST[$key]) {$_POST[$key]= $list_row[$key]; } } }else $org_id = false; //echo "org_id = ".$org_id; if($org_id) $_SESSION[org_id] = $org_id; //next function outputs the comments on this blog function writeContents() { global $user_row; global $link; //start of multipage insert 1 // 1. how many rows to show per page $rowsPerPage = 5; // 2. by default we show first page $pageNum = 1; // 3. if $_GET['page'] passed from previous URL, use it as page number if(isset($_GET['page'])) { $pageNum = $_GET['page']; } // 4. counting the offset $offset = ($pageNum - 1) * $rowsPerPage; //end of multipage insert 1 //incorporating the seach variables into the select query: if($_SESSION['user_id']) $user_id = $_SESSION['user_id']; $query = "SELECT * FROM comments WHERE "; $sql = ""; $query .= " is_blocked = 'n' "; //filter out blocked content $sql .= " is_blocked = 'n' "; if($_SESSION[org_id]){ $org_id = $_SESSION[org_id]; $query .= " AND org_id = '$org_id' "; $sql .= " AND org_id = '$org_id' "; } if($_POST['month'] != 'a' && $_POST['year'] != 0) {$List = getDateRange($_POST['month'], $_POST['year']); //returns two timestamps for start and end of the month $query .= " AND create_date > '$List[0]' "; $sql .= " AND create_date > '$List[0]' "; $query .= " AND create_date < '$List[1]' "; $sql .= " AND create_date < '$List[1]' "; } $query .= " ORDER by create_date DESC"; $query .= " LIMIT $offset, $rowsPerPage "; //start of multipage insert 2 /* Paging is implemented in MySQL using LIMIT that take two arguments. The first argument specifies the offset of the first row to return, the second specifies the maximum number of rows to return. The offset of the first row is 0 ( not 1 ). */ //end of multipage insert 2, rest of inserts are in the main script. $result = mysql_query($query, $link); if(!result) die("getIDcontents fatal error : ".mysql_error); //$result = getRecipes($user_row[user_id]); //if calling outside function if ($result) $numrows = mysql_num_rows($result); if ($result) $numcols = mysql_num_fields($result); if (!$result) { echo "
Search result: No blogs,
Try another search combination.
Number of results displayed = ".$numrows, "
"; $displayed = $numrows; echo ""; } }//end of if($numrows > 0) //start of mulipage insert 4 //5. how many rows we have in database $user_id = $_SESSION['user_id']; $query = "SELECT COUNT(comment_id) AS numrows FROM comments WHERE "; $query .= $sql; $result = mysql_query($query) or die('Error, query failed'); $row = mysql_fetch_array($result, MYSQL_ASSOC); $numrows = $row['numrows']; if($numrows > 0){ //echo "Total number of results = ".$numrows, "
"; echo "Showing ".$displayed. " [of Total ".$numrows."].
"; }else echo "0 comments.
"; //echo "0 comments yet,
Please create one on the box provided.
Search result: No Listings.
"; return; } else{ //start of multipage insert 3 (insert 1 & 2 are in the function getRecipes in dblib) //4. output results //end of multipage insert 3 if($numrows > 0) { //get $country_type to use in countAdverts.inc $country_type = get_Country_Type($user_row[countr_code]); echo "
".$org_name."";
echo ''.ucwords(strtolower($org_name)).''; //echo "user_id_fro = ".$user_id_fro; if($_SESSION[user_id] and ($_SESSION[user_id]<3) and ($user_id_fro < 3)){ $invite_row = getRow("orgInvites", "org_id", $org_id); if(!$invite_row[invite_id]) echo " admin invite"; } echo ""; $org_adrs = ucwords(strtolower($_POST[org_adrs])); $replace_icon = ""; if($org_adrs){ if($_POST[org_descr]) $org_adrs = str_replace('¬', ' ', $org_adrs); //replace ¬ by space else $org_adrs = str_replace('¬', ' ', $org_adrs); //replace ¬ by space $org_adrs = str_replace('@', $replace_icon, $org_adrs); //replace ¬ by space echo ''.$org_adrs.'. '; } $org_phone = $_POST[org_phone]; if($org_phone){ if($_POST[org_descr]) echo ' Phone '.$org_phone.''; else echo ' Phone '.$org_phone.''; } if($_POST[countr_code]){ $Country = getRow(country, countr_code, $_POST[countr_code]); //echo " | ".ucwords(strtolower($Country[countr_name])); echo " "; }else echo " "; //echo " contact us "; //if($user_id_fro == $current_user_id) echo " edit this page \n"; //elseif($user_id_fro >=3 and $_SESSION[user_id]) //echo "contact us \n"; /* if($row[user_pictname]){ echo ""; echo ""; echo " $row[user_name]"; echo ""; } */ /////////////////////////start /* $org_id = $_POST[org_id]; if ($_POST[logoname]){ //show page picture $myImage = getimagesize("upload_logo_pics/".$_POST[logoname].$_POST[logo_pictype]); //image width = $myImage[0]; echo ""; //echo ""; echo ""; echo " $_POST[org_name]"; echo ""; } if (!$_POST[logoname]) { //show blank user picture echo ""; echo ""; echo " - - page pict - -"; echo " upload picture"; echo ""; } */ /////////////////////////end /* //latest notices if (isset($_GET[id])) $org_id = $_GET[id]; $latestNotice = getLastNotice(notices, org_id, $org_id); $PostedBy = getRow(users, user_id, $latestNotice[user_id_fro]); if($PostedBy[user_name]) { echo " Update : ";
}
//echo $latestNotice[user_id_fro];
*/
//replace linebreak
$linebreak = '"; $latestNotice[description] = str_replace('¬', ' ', $latestNotice[description]); //replace ¬ by space echo $latestNotice[description].' by '.$PostedBy[user_name]; echo ", ".date("j F Y", $latestNotice[create_date]).". '; $tempChar = "¬"; $org_descr = str_replace($tempChar, $linebreak, $org_descr); //replace ; by _ //replace linebreak $linebreak = ' '; $tempChar = " "; $org_descr = str_replace($tempChar, $linebreak, $org_descr); //replace ; by _ //replace character $org_descr = str_replace('ª', ' ', $org_descr); //replace foriden filename charcater by - //bold text $org_descr = str_replace("[", "", $org_descr); //replace ^ by ' $org_descr = str_replace("]", "", $org_descr); //replace ^ by ' if($org_descr) echo ' About Us : '; $org_url = $_POST[org_url]; $phrase = substr($org_url, 0, 7); if($phrase == 'http://') $org_url = substr($org_url, 7); if($org_url) { if(stristr($org_url, 'www')) { echo "Website : ".$org_url." "; $is_url = 'y'; } }else echo "Website : not provided "; //if(!$_GET[url]) //echo "Link up: get icon "; //category //echo "Category : ".$_POST[category]." "; //start of views and updated echo " (page updated : ".date("j F Y", $create_date)."\n"; $row = getRow(users, user_id, $user_id_fro); $org_id = $_POST[org_id]; $lastViews = $_POST[views]; if(!$lastViews) $lastViews = 1; //call function to update page views updateViews($lastViews, $org_id); if($lastViews == 1) echo ", viewed : once.)"; else echo ", viewed : ".$lastViews." times.)"; //end of views and updated //if($org_url) //echo "org_url = ".$org_url; ?> "; //echo '$_SESSION[user_id] = '.$_SESSION[user_id]; //echo '$user_row[user_id] = '.$user_row[user_id]; //echo '$_SESSION[org_id] = '.$_SESSION[org_id]; //echo '$_POST[user_id_update] = '.$_POST[user_id_update]; if($_GET[url] == 'y') $show_link = 'y'; else $show_link = 'n'; //start of form if($show_link == 'y'){ ?>
Link up: create a web page for your community group, club, organisation, business, college, school, etc. ';
include( "contact_me.php");
include( "my_inc".DIRECTORY_SEPARATOR."tag_cloud_ZW.php");
?>
|
"; echo " viewing a posted page"; }else include( "my_inc".DIRECTORY_SEPARATOR."displayFace.inc"); } if($_POST[user_id_update] == $user_row[user_id]) $current = 'page'; else $current = 'viewing'; //include( "my_inc".DIRECTORY_SEPARATOR."verticalMenuLPage.inc"); ?> See also :"; echo "
"; echo $display; } if(!$_SESSION[user_id]){ //echo 'create a web page for your community group, club, organisation, business, college, school, etc. '; //echo ' If you would like to become the editor of this particular group you can send a request to the administrator after signing in '; } /* if($_SESSION[user_id]){ if(($user_id_fro < 3) and ($_SESSION[user_id] != $user_id_fro)) echo 'If you would like to become the editor of this particular group you can send a request to the administrator. '; } */ ?> "; */ //echo "";
//echo "";
if($_SESSION[user_id]){
if($_SESSION[page_set])
echo "My pages :";
else
echo "See also :";
listCategories(1);
}
//echo " ";
//echo 'view more groups'; if($_SESSION[user_id] and ($_SESSION[user_id] <= '2') ){ //echo "upload document"; $org_id = $_SESSION[org_id]; echo " upload doc | "; echo "view all "; } //if($_SESSION[user_id]) //writeOrgPics(); //if($_SESSION[user_id]) //writeOrgDocs($org_id); ?> |
|