Help - Search - Member List - Calendar
Full Version: View all page (new feature)
Krazy Letter Forums > Members stuff > Computer Programs > PHPKImageHost > Feature Requests
cooldance
Hi there.

I just have a request for a few new features.

==viewall page

I would like a viewall page whith navigation. Alsmost the same as the admin page when deleting images. Only not with the delete function on it.

option1: just the tumb, description and how many times the file has been downloaded.
option 2: select one or more tumbs, press a button and create html code and BBcode for that or these thumbs. (like after uploading a file)

I am not that good with PHP yet to create it myself. I tried for a few weeks now but i don't understand it yet.
--------------------------------------------------------------------------------------------
I have added an option myself
People can enter the url of their website (nice for generating traffic)

The URL is shown in the Cool Features (random tumb and last added)

I removed the link. It was not for purpose of commerce. Sorry!!

The site is not active yet i'm still working on the functionality and the layout.
issac55
Take a look at your website for once.OMG. there is enough of those sites out there, and i would like you to advirtise that crap somewhere else.
cooldance
QUOTE(issac55 @ May 20 2006, 01:40 AM)
Take a look at your website for once.OMG. there is enough of those sites out there, and i would like you to advirtise that crap somewhere else.
*



Hi Isaac,

I didn't mean to advertise on this site. oops.gif
I know there are a lot of these sites out there but every site has a purpose. happy.gif

I was looking for a script that fitted my needs and found it here. I'm verry greatfull. When my site is fully functional I wil Donate Gladly.

Let me know!!
Mynck
QUOTE(issac55 @ May 19 2006, 04:40 PM)
Take a look at your website for once.OMG. there is enough of those sites out there, and i would like you to advirtise that crap somewhere else.
*


Don't be too mean now... happy.gif
lappy512
I haven't worked on this script for a while, but Spaceman3750 has told me that he wanted to continue this project, so smile.gif
issac55
umm....mean. i've seen worse when pyrofalkon was here.
lappy512
Oh, well he was showcasing his site powered by PHPKImageHost, the script I started developing. It just happens to have Adult content on there. I think he had a warning though...
Threatcon
QUOTE(cooldance @ May 19 2006, 06:33 PM)
Hi there.

I just have a request for a few new features.

==viewall page

I would like a viewall page whith navigation. Alsmost the same as the admin page when deleting images. Only not with the delete function on it.


Like this?
http://www.maxogc.com/image_hosting/view_all.php
issac55
yes..
Threatcon
Save the below code as view_all.php and put it in the root directory with your other phpKImageHost files.
Demo
http://www.maxogc.com/image_hosting/view_all.php


CODE

<?php
include "header.php";
   if ($_GET['page'])
   {
    $limit = $_GET['page'] * 20 - 20;
    $limit = "LIMIT " . $limit . ",20";
    $page=$_GET['page'];
   }
   else
   {
    $limit = "LIMIT 20";
    $page = 1;
   }
   //Lets try connecting to mySQL
   @ $db = mysql_pconnect($mysql['host'], $mysql['user'], $mysql['pass']);
   //IT"S NOT WORKING!
   if (!$db)
   {
    die("error");
   }
   mysql_select_db($mysql['db']);

   //Lets see what images we have...
   $query = "SELECT * FROM images";

   //Suspense is killing me. Lets see.
   $pagesquery = mysql_query($query);

   $num_rows = mysql_num_rows($pagesquery);
   
   if(intval($num_rows / 20) != ($num_rows / 20))
   {
    $totalpages = intval($num_rows / 20) + 1;
   }
   else
   {
    $totalpages = $num_rows / 20;
   }
   echo "<br><b>Page:</b><br>";
   //Dunno how to make the page list without it being inefficient...Oh well, this works...for now.
   
   if($page > 1)
   {
    echo '&nbsp;&nbsp;<a href="view_all.php?page=' . ($page-1) . '">Previous</a>&nbsp;&nbsp;';
   }
   echo '&nbsp;&nbsp;<a href="view_all.php?page=1">1</a>&nbsp;&nbsp;';
   if ($totalpages>1)
   {
    echo '<a href="view_all.php?page=2">2</a>&nbsp;&nbsp;';
   }
   if ($totalpages>3)
   {
    if($totalpages>4)
    {
     if($page >3)
     {
      echo '...&nbsp;&nbsp;';
     }
     if($page > 3 and $page < $totalpages)
     {
      echo '<a href="view_all.php?page=' . ($page-1) . '">' . ($page-1) . '</a>&nbsp;&nbsp;';
     }
     if($page < $totalpages-1 and $page > 2)
     {
      echo $page . '&nbsp;&nbsp;';
     }
     if($page > 1 and $page < $totalpages-2)
     {
      echo '<a href="view_all.php?page=' . ($page+1) . '">' . ($page+1) . '</a>&nbsp;&nbsp;';
     }
     if($page<$totalpages-2)
     {
      echo '...&nbsp;&nbsp;';
     }
    }
    echo '<a href="view_all.php?page=' . ($totalpages-1) . '">' . ($totalpages-1) . '</a>&nbsp;&nbsp;';
   }
   if ($totalpages>2)
   {
    echo '<a href="view_all.php?page=' . $totalpages . '">' . $totalpages . '</a>&nbsp;&nbsp;';
   }
   if($page != $totalpages)
   {
   echo '&nbsp;&nbsp;<a href="view_all.php?page=' . ($page+1) . '">Next</a>&nbsp;&nbsp;';
   }
   echo "<br><br><br>";

   //That was a lot of code for a seemingly simple thing.


   //Lets see what images we have...
   $query = "SELECT * FROM images ORDER BY `id` ASC " . $limit;

   //Suspense is killing me. Lets see.
   $result = mysql_query($query);

   $num_results = mysql_num_rows($result);
   if($num_results == 0)
   {
    echo "<font class='extra'><br><br><br>No results<br><br><br></font>";
   }
   if(intval($num_results/4) == ($num_results/4))
   {
    $tablerows = $num_results/4;
   }
   else
   {
    $tablerows = intval($num_results/4) + 1;
   }
   echo "<table>";
   for ($i = 0; $i < $tablerows; $i++)
   {
    echo "<tr>";
    for($c = 0; $c < 4; $c++)
    {
     echo "<td>";
     $row = mysql_fetch_array($result);
     if(!$row)
     {
      break;
     }
     $id = $row['id'];
     echo '<div id="' . $id . '"><a href="view/' . $id . '"><img src="uploads/thumb_' . $id . '" border="1"></a>&nbsp;&nbsp;<br>';
     $comments = $row['comments'];
     echo '<font class="txt"><b>Comments:</b><br>';
     echo (stripslashes($comments));
     $size = round($row['size']/1024);
     $views = $english_format_number = number_format($row['downloads']);
     echo '<br><b>Original size:</b> '. $size .' KB<br><b>Viewed:</b> '. $views .' times</font><br>';
     echo "</td>";
    }
    echo "</tr>";
   }
   echo "</table>";
   include "footer.php";
   die();
include "footer.php";
?>


EDIT
Now includes the comments, thumbnail size and how many times the image was viewed.
cooldance
biggrin.gif Thanks Threatcon.

That's allmost waht i was looking for. I just cooldn't get the navigation working. I will build in my own things with your script.. Thanks Verry Much!!!! cool.gif

EDIT:
I used your script and added a littlebit. It works real good now. Thanks for helpin. If you have more cool extra's like voting system or something please email me

cooldance ad gmail.com
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2010 Invision Power Services, Inc.