Closed GoogleCodeExporter closed 9 years ago
Sorry! my website: www.startmodel.hu
Original comment by startmo...@gmail.com
on 26 Sep 2010 at 3:13
I' have write this code, but is not ready. Maybe someone need:
<?php require_once('connections/startmodel.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "",
$theNotDefinedValue = "")
{
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
$currentPage = $_SERVER["PHP_SELF"];
$maxRows_kepek = 20;
$pageNum_kepek = 0;
if (isset($_GET['pageNum_kepek'])) {
$pageNum_kepek = $_GET['pageNum_kepek'];
}
$startRow_kepek = $pageNum_kepek * $maxRows_kepek;
mysql_select_db($database_startmodel, $startmodel);
$query_kepek = "SELECT *
FROM
wp_bp_album
INNER JOIN wp_users ON (wp_bp_album.owner_id = wp_users.ID)
ORDER BY
wp_bp_album.date_uploaded DESC";
$query_limit_kepek = sprintf("%s LIMIT %d, %d", $query_kepek, $startRow_kepek,
$maxRows_kepek);
$kepek = mysql_query($query_limit_kepek, $startmodel) or die(mysql_error());
$row_kepek = mysql_fetch_assoc($kepek);
if (isset($_GET['totalRows_kepek'])) {
$totalRows_kepek = $_GET['totalRows_kepek'];
} else {
$all_kepek = mysql_query($query_kepek);
$totalRows_kepek = mysql_num_rows($all_kepek);
}
$totalPages_kepek = ceil($totalRows_kepek/$maxRows_kepek)-1;
$queryString_kepek = "";
if (!empty($_SERVER['QUERY_STRING'])) {
$params = explode("&", $_SERVER['QUERY_STRING']);
$newParams = array();
foreach ($params as $param) {
if (stristr($param, "pageNum_kepek") == false &&
stristr($param, "totalRows_kepek") == false) {
array_push($newParams, $param);
}
}
if (count($newParams) != 0) {
$queryString_kepek = "&" . htmlentities(implode("&", $newParams));
}
}
$queryString_kepek = sprintf("&totalRows_kepek=%d%s", $totalRows_kepek,
$queryString_kepek);
?><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2">
<title>Untitled Document</title>
</head>
<body>
<table border="0">
<tr>
<td><?php if ($pageNum_kepek > 0) { // Show if not first page ?>
<a href="<?php printf("%s?pageNum_kepek=%d%s", 'kepek',$currentPage, 0, $queryString_kepek); ?>">Első</a>
<?php } // Show if not first page ?>
</td>
<td><?php if ($pageNum_kepek > 0) { // Show if not first page ?>
<a href="<?php printf("%s?pageNum_kepek=%d%s", 'kepek',$currentPage, max(0, $pageNum_kepek - 1), $queryString_kepek); ?>">Előző</a>
<?php } // Show if not first page ?>
</td>
<td><?php if ($pageNum_kepek < $totalPages_kepek) { // Show if not last page ?>
<a href="<?php printf("%s?pageNum_kepek=%d%s", 'kepek',$currentPage, min($totalPages_kepek, $pageNum_kepek + 1), $queryString_kepek); ?>">Következő</a>
<?php } // Show if not last page ?>
</td>
<td><?php if ($pageNum_kepek < $totalPages_kepek) { // Show if not last page ?>
<a href="<?php printf("%s?pageNum_kepek=%d%s", 'kepek',$currentPage, $totalPages_kepek, $queryString_kepek); ?>">Utolsó</a>
<?php } // Show if not last page ?>
</td>
</tr>
</table>
<p> </p>
<table>
<tr>
<td></td>
<td></td>
</tr>
<?php do { ?>
<tr>
<td><a href="<?php echo $row_kepek['user_url']; ?>album/picture/<?php echo $row_kepek['id']; ?>/"><img src="<?php echo $row_kepek['pic_thumb_url']; ?>" alt=""></a><a href="<?php echo $row_kepek['pic_mid_url']; ?>"></a></td>
<td> </td>
</tr>
<tr>
<td><a href="<?php echo $row_kepek['user_url']; ?>"></a></td>
<td> </td>
</tr>
<?php } while ($row_kepek = mysql_fetch_assoc($kepek)); ?>
</table>
<p> Records <?php echo ($startRow_kepek + 1) ?> to <?php echo
min($startRow_kepek + $maxRows_kepek, $totalRows_kepek) ?> of <?php echo
$totalRows_kepek ?>
<?php
mysql_free_result($kepek);
?>
<p>
<table border="0">
<tr>
<td><?php if ($pageNum_kepek > 0) { // Show if not first page ?>
<a href="<?php printf("%s?pageNum_kepek=%d%s", 'kepek',$currentPage, 0, $queryString_kepek); ?>">Első</a>
<?php } // Show if not first page ?>
</td>
<td><?php if ($pageNum_kepek > 0) { // Show if not first page ?>
<a href="<?php printf("%s?pageNum_kepek=%d%s", 'kepek',$currentPage, max(0, $pageNum_kepek - 1), $queryString_kepek); ?>">Előző</a>
<?php } // Show if not first page ?>
</td>
<td><?php if ($pageNum_kepek < $totalPages_kepek) { // Show if not last page ?>
<a href="<?php printf("%s?pageNum_kepek=%d%s", 'kepek',$currentPage, min($totalPages_kepek, $pageNum_kepek + 1), $queryString_kepek); ?>">Következő</a>
<?php } // Show if not last page ?>
</td>
<td><?php if ($pageNum_kepek < $totalPages_kepek) { // Show if not last page ?>
<a href="<?php printf("%s?pageNum_kepek=%d%s", 'kepek',$currentPage, $totalPages_kepek, $queryString_kepek); ?>">Utolsó</a>
<?php } // Show if not last page ?>
</td>
</tr>
</table>
Original comment by startmo...@gmail.com
on 30 Oct 2010 at 12:18
THis functionality is already part of the "Featured Content" class in version
0.1.9
Original comment by CarlRoett@gmail.com
on 16 Dec 2010 at 7:52
Original issue reported on code.google.com by
startmo...@gmail.com
on 26 Sep 2010 at 3:11