Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3

Thread: Viewing...

  1. #1
    New Coder
    Join Date
    Apr 2009
    Location
    UK
    Posts
    56
    Thanks
    5
    Thanked 1 Time in 1 Post

    Viewing...

    So, I have the pagination sorted for this sitt I have a slight issue. I cannot get the image and the action div table next to it, and the next one below it.

    If you don't get what I mean, it should look like:

    PICTURE OF IMAGE | Delete....
    PICTURE OF IMAGE | Delete....

    Not: PICTURE OF IMAGE | Delete.... | PICTURE OF IMAGE | Delete....

    and so on.

    Screenshot:http://jameskealey.po.gs/pick/1/09a02.jpg

    CSS CODE:
    Code:
    /* CSS Document */
    .title {
    	font-family: Verdana;
    	font-size: large;
    	font-weight: bold;
    	text-align:center;
    }
    .links {
    	font-family: verdana;
    	font-size: small;
    	text-align:center;
    }
    .error {
    	font-family: Verdana;
    	font-size: small;
    	color: red;
    }
    .font {
    	font-family: verdana;
    	font-size: small;
    }
    .font2 {
    	font-family: Verdana;
    	font-size:xx-small;
    }
    .test1 {
    	border: 1px #000000 solid;
    	width: 100px;
    	height: 100px;
    	float: left;
    }
    .test2 {
    	border: 1px #000000 solid;
    	width: 100px;
    	height: 100px;
    	float: left;
    }
    THE PHP FILE:
    PHP Code:
    <title>picK Moderation</title>
    <link rel="stylesheet" type="text/css" href="admin.css" />
    <?
    require 'paginate.class.php';
    $page = isset($_GET['page']) ? $_GET['page'] : 1;
    session_start();
    if (!
    session_is_registered(myusername)) {
        
    header("location:admin.php");
    }

    include (
    "config.php");
    function 
    getExtension($str)
    {
        
    $i strrpos($str".");
        if (!
    $i) {
            return 
    "";
        }
        
    $l strlen($str) - $i;
        
    $ext substr($str$i 1$l);
        return 
    $ext;
    }
    echo 
    "<br><div class='title'>picK File Moderation</div>";
    echo 
    "<div class='links'><a href=index.php>picK Home</a>| <a href=admin_success.php>Moderation</a> | <a href=admin_success.php?p=u>Ban List</a> | <a href=admin_logout.php>Logout</a></div><div align='center' class='font'><br><br>";

    $con mysql_connect($data_server$data_user$data_pw) or die("<div class='error'>Couldn't connect to Database. Try again.</div>");
    mysql_select_db("jkealey");
    if (
    $_GET['p'] == "") {
        
    // Query to run
        
    $query "SELECT * FROM image_table ";
        
        
    // Load paginator
        
    $paginator = new pagination($page$query);
        
        
    // Number of results on each page
        
    $paginator->results_per_page 10;
        
        
    // Number of pages to show around current page number in links
        
    $paginator->padding(2);
        
        
    // Link prefix before page number
        
    $paginator->link_prefix '?page=';
        
        
    // Paginate the results
        
    $page_links $paginator->paginate();
        
        
    // Echo out the page links
        
    echo $page_links;
       
        while (
    $row mysql_fetch_array($paginator->resource())) {
            
    $filename $row['image'];
            
    $extension getExtension($filename);
            
    $extension strtolower($extension);
            if (
    $row['image'] == "") {
            } else {
                if (
    $extension == "jpeg" || $extension == "jpg" || $extension == "png" || $extension ==
                    
    "gif" || $extension == "bmp") {
                    
    //Echo Link
                    
    echo "<div class='test1'><a href='";
                    echo 
    $row['image'];
                    echo 
    "' border='0'>";
                    echo 
    "<img src='";
                    echo 
    $row['image'];
                    echo 
    "' width='90px' height='90px' border='0'></a></div>";
                } else {
                    
    //IF NOT AN IMAGE
                    //CLICK HERE LINK
                    
    echo "<font face=verdana size='1'>";
                    echo 
    "<div class='test2'><a href='";
                    echo 
    $row['image'];
                    echo 
    "'>Click here</a></div>";
                }
                
    //BAN & DELETE
                
    echo "<div class='test2'><font size='1'><a href='deleted.php?name=";
                echo 
    $row['image'];
                echo 
    "'>Delete File</a><br>";
                echo 
    "<a href='ban.php?ip=";
                echo 
    $row['ip'];
                echo 
    "'>Ban IP</a>";
                echo 
    "<br /><i>";
                echo 
    $row['ip'];
                echo 
    "</i>";
                echo 
    "</font></div>";
            }
        }
    }
    if (
    $_GET['p'] == "u") {
        
    mysql_connect($data_server$data_user$data_pw) or die("Couldn't connect to Database. Try again.");
        
    mysql_select_db("jkealey");
        
    $result mysql_query("SELECT * FROM banip ") or die(mysql_error());
        print 
    "<center><table border='1'>";
        while (
    $row mysql_fetch_array($result)) {
            print 
    "<tr><td>";
            print 
    $row['IP'];
            print 
    "</td><td>";
            print 
    "<a href='unban.php?ip=";
            print 
    $row['IP'];
            print 
    "'>Unban IP</a></td></tr></div>";
        }
    }
    ?>
    Hope this is clear.

    James

  • #2
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,464
    Thanks
    8
    Thanked 1,085 Times in 1,076 Posts
    //BAN & DELETE
    echo "<div class='test2'><font size='1'><a href='deleted.php?name=";
    echo $row['image'];
    echo "'>Delete File</a><br>";
    echo "<a href='ban.php?ip=";
    echo $row['ip'];
    echo "'>Ban IP</a>";
    echo "<br /><i>";
    echo $row['ip'];
    echo "</i>";
    echo "</font></div>";
    echo "<div style='clear:both;'></div>";
    }
    }
    }
    if ($_GET['p'] == "u") {

  • Users who have thanked mlseim for this post:

    jamesk (02-16-2010)

  • #3
    New Coder
    Join Date
    Apr 2009
    Location
    UK
    Posts
    56
    Thanks
    5
    Thanked 1 Time in 1 Post
    Brilliant!

    Cheers


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •