Page 1 of 2 1 2 LastLast
Results 1 to 8 of 14

Thread: phpMyAdmin help...

  1. #1
    Newbie S3NTYN3L may be famous one day S3NTYN3L may be famous one day S3NTYN3L's Avatar
    Join Date
    Sep 2005
    Location
    Blito-P3
    Posts
    21
    Thanks
    0
    Thanked 0 Times in 0 Posts

    phpMyAdmin help...

    I'm wanting to make a random sig.

    All the scripts I've seen are in PHP format so I went ahead and found a site that supports php with it's free hosting.

    Trouble now is that I've NO IDEA how to use this phpMyAdmin thing.

    Can someone PLEASE help me out?

  2. #2
    Grouchy Old Anime Otaku LenMiyata has become well known LenMiyata has become well known LenMiyata has become well known LenMiyata's Avatar
    Join Date
    Jan 2005
    Location
    Silicon Valley, California
    Posts
    5,477
    Thanks
    0
    Thanked 172 Times in 147 Posts

    Re: phpMyAdmin help...

    Grumble Grumble Grumble

    PHP is a web script issue, and belongs in the Graphics/Wallpaper/Web Design forum...

    Moving...
    FAVOURITE THREADS EXPLAIN why, or risk an infraction.
    Rantings of a Grouchy Old Anime Otaku

  3. #3
    Otaku know1 may be famous one day know1 may be famous one day know1's Avatar
    Join Date
    May 2005
    Location
    here
    Posts
    270
    Thanks
    0
    Thanked 5 Times in 4 Posts

    Re: phpMyAdmin help...

    For starters, phpMyadmin is a prebuilt application/program tool that uses PHP scripts to control MySQL data over HTML. It may be able to do what you need, but has alot of extra functions and scripts that you do not need. You might want to search out a PHP script that is more suited for your purposes, and above all, is a singular entity. I have not researched the full functionality of phpMyadmin, but I can assure you that installing an entire content management system is overkill for switching images in a folder.

    That said, there are other solutions, such as custom pearl scripts from your CGI-BIN, although I don't know if you can use .cgi files for image files on AO. I guess the same would apply to any php statements as well.

    I'll check it out for you,,,,im somewhat interested myself.

    Edit------------

    This appeared to have worked. Follow this code I found (note that it is NOT MY CODE, AND YOU SHOULD FOLLOW THE CREATER"S GUIDLINES OF USAGE). Check out their website for credit info SCRIPT

    Open your "note pad" of plain text editor, and paste the following code, INCLUDING THE AUTHORS STATEMENT (only copy between the lines):

    --------------------------------------------------------------------------

    #! /usr/local/bin/perl
    ################################################## ############################
    # Basic Random Image Displayer Version 1.2 #
    # Copyright 1996 Matt Wright [email protected] #
    # Created 7/1/95 Last Modified 7/20/95 #
    # Scripts Archive at: http://www.scriptarchive.com/ #
    ################################################## ############################
    # COPYRIGHT NOTICE #
    # Copyright 1996 Matthew M. Wright All Rights Reserved. #
    # #
    # Basic Random Image may be used and modified free of charge by anyone so #
    # long as this copyright notice and the comments above remain intact. By #
    # using this this code you agree to indemnify Matthew M. Wright from any #
    # liability that might arise from it's use. #
    # #
    # Selling the code for this program without prior written consent is #
    # expressly forbidden. In other words, please ask first before you try and #
    # make money off of my program. #
    # #
    # Obtain permission before redistributing this software over the Internet or #
    # in any other medium. In all cases copyright and header must remain intact.#
    ################################################## ############################
    # Necessary Variables
    $basedir = "http://www.rithm.net/images/";
    @files = ("test1.gif","test2.gif","test3.gif","test4.jpg ");

    # Options
    $uselog = 0; # 1 = YES; 0 = NO
    $logfile = "/home/YOURURL/public_html/images/piclog";

    # Done
    ################################################## ############################

    srand(time ^ $$);
    $num = rand(@files); # Pick a Random Number

    # Print Out Header With Random Filename and Base Directory
    print "Location: $basedir$files[$num]\n\n";

    # Log Image
    if ($uselog eq '1') {
    open (LOG, ">>$logfile");
    print LOG "$files[$num]\n";
    close (LOG);
    }





    -------------------------------------------------------

    Next, adjust the variables $basedir and $logfile to reflect your placement of the image files. (NOTE: mine says "http://www.rithm.net/images/" Use your URL path to your images here.

    Where it says on mine "/home/YOURURL/public_html/image/piclog"- this is the absolute path to the image folder. You might have to change more of it, but for now, just change the "YOURURL" part, and then follow the public path.

    Next, adjust the image names and extentions, and add more if you want.

    Two more steps.

    Save this text file as an ASCII file and make sure the extention is .pl (as in "textfile.pl")

    Upload it to your cgi-bin, and change the permission set to 755.
    Upload your images in the "images" folder in the root.
    --------------------------------------------------------

    Now, when you want to place your random array of images, use your path to the script. ie "http://www.YOURURL.com/cgi-bin/textfile.pl"

    The browser will read this, and gets a random picture from the "http://www.YOURURL.com/images/" folder.


    PM me if ou have any issues. Your server will have to have a CGI-BIN, and the current path to cgi might not be the exact one as yours.


    EDIT AGAIN-----sorry for the long post-------

    One thing I noticed though. This random script does not prevent image caching. Somehow this presents a conflict, where the 'randomness" is less random once the image has been displayed once. It seemed to have worked for a bit, but now gets stuck on one color (on my sig).
    Last edited by know1; Sep 13, 2005 at 10:52 PM.

  4. #4
    Newbie S3NTYN3L may be famous one day S3NTYN3L may be famous one day S3NTYN3L's Avatar
    Join Date
    Sep 2005
    Location
    Blito-P3
    Posts
    21
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: phpMyAdmin help...

    Thanx for the reply know1.

    Here is the code I'm wanting to use:
    Code:
    <?php
    
    //////////////////////////////////////////////////////////////////////
    
    /*                  Suho1004\'s PHP Sig Rotator V2.0                 */
    
    /*                                                                  */
    
    /* This script takes an inventory of all image files in a directory */
    
    /* and displays one at random. All you need to do is save this code */
    
    /* in a directory that contains your images (name it what you will, */
    
    /* but make sure it has a \".php\" extension). Then just link to this */
    
    /* script to get your random image.                                 */
    
    /*                                                                  */
    
    /* I would recommend naming this file \"index.php,\" and then you can */
    
    /* just link to the directory itself (like I do in my example).     */
    
    /*                                                                  */
    
    /* Once you\'ve read these instructions, feel free to delete them to */
    
    /* cut down on the file size. I claim no rights to this code, which */
    
    /* means you can do whatever you like with it. Have fun. :-)        */
    
    /*                                                                  */
    
    /* Thanks to TP for the gentle nudging...                           */
    
    //////////////////////////////////////////////////////////////////////
    
    
    
    if ($dir = opendir(\".\"))
    
    {
    
         $list = buildimagearray($dir);
    
         displayrandomimage($list);
    
    }
    
    
    
    // This function reads all the files in the current directory and adds all image files to the array $list[]
    
    function buildimagearray($dir)
    
    {
    
         while (false !== ($file = readdir($dir)))
    
         {
    
              if (!is_dir($file) && getimagesize($file))
    
              {
    
                   $list[] = $file;
    
              }
    
         }
    
         return $list;
    
    }
    
    
    
    // This function selects a random image, determines the mime type, opens the file for reading,
    
    // and then outputs the image
    
    function displayrandomimage($list)
    
    {
    
         srand ((double) microtime() * 10000000);
    
         $sig = array_rand ($list);
    
    
    
         $size = getimagesize ($list[$sig]);
    
         $fp = fopen($list[$sig], \"rb\");
    
    
    
         if ($size && $fp)
    
         {
    
              header(\"Content-type: {$size[\'mime\']}\");
    
              fpassthru($fp);
    
              exit;
    
         }
    
    }
    
    ?>
    I'm using THIS free web host. I'm using the ftp app that came with windows xp...
    I haven't installed anything on my machine. The phpMyAdmin seems to be web-based...
    I found other free hosting services, they all use MyAdmin.

    You talk about editing $basedir and other things with phpMyAdmin but, alas, I'm COMPLETELY CLUELESS when it comes to this application.

    Alot of hand-holding is what I'm needing in this case...

    I look forward to your help.
    Last edited by S3NTYN3L; Sep 14, 2005 at 09:02 AM.

  5. #5
    M A S T E R Zui Quan may be famous one day Zui Quan may be famous one day Zui Quan's Avatar
    Join Date
    Oct 2004
    Location
    A Vastly Superior Place
    Posts
    1,726
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: phpMyAdmin help...

    Let's simplify things here.

    First, phpMyAdmin is the interface for managing a mySql database or another type of database. What you are trying to do doesn't involve a database, so ignore phpMyAdmin.

    Second, here is how you use your sig randomizer code. Create a directory in your webspace for the sigs you want to rotate (i.e. http://www.yoururlhere.com/sigs). Next put all your sigs in in this new directory. Third, rename your randomizing code to something like "rotate.php" and put it in the directory. After you do this you should have a set up something like this:

    Directory: http://www.yoururlhere.com/sigs
    contents: sig1.jpg
    sig2.jpg
    sig3.jpg
    rotate.php

    In your control panel here at AO, you'll want to link to the rotation script by entering [img*]http://yoururlhere.com/sigs/rotate.php[/img*] (you'll need to remove the *'s).

    Here's a live example:
    On my website marklab.com, I created a directory called sigs (http://marklab.com/sigs) which contains the following items:

    brilliantsig.jpg
    mqsig.gif
    serve.jpg
    rotate.php

    by using the IMG code to link to rotate.php ([img*]http://marklab.com/sigs/rotate.php[/img*] -the *'s are removed in the actual code), you should see a new sig here everytime the page is refreshed.



    Hope this is helpful. If your code doesn't work, I have another image randomizer code that DOES work.
    Clan? What Clan?
    I'm the Master. I need no Clan.

  6. #6
    Newbie S3NTYN3L may be famous one day S3NTYN3L may be famous one day S3NTYN3L's Avatar
    Join Date
    Sep 2005
    Location
    Blito-P3
    Posts
    21
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: phpMyAdmin help...

    Thanx Zui...

    Well, I must be a complete retard... I can log into my host using ftp from the command prompt but it won't let me upload anything.

    What am I doing wrong?

    I'm sorry to say I still need more hand-holding...

    Thanx for your understanding...

  7. #7
    Otaku know1 may be famous one day know1 may be famous one day know1's Avatar
    Join Date
    May 2005
    Location
    here
    Posts
    270
    Thanks
    0
    Thanked 5 Times in 4 Posts

    Re: phpMyAdmin help...

    You might want to check the chmod permission set for the folder. In a FTP application, highlight the desired folder, then either right-click it/properties, or menu select properties to find the permission set. You will either see a three digit number (like: 400, 700, 755), or you will see the letter representations ( r=read w=write x=exicute, in three sets- owner, group, world....for example chmod code 400 = r-------- and code 777 = rwxrwxrwx).

    For your purposes, I think chmod code 600 ( rw------- ) would work, but to test the folder, 777 would make it open to everyone.

    If that doesn't work, then you may have to check out the user name and passwords are set to admin.

  8. #8
    M A S T E R Zui Quan may be famous one day Zui Quan may be famous one day Zui Quan's Avatar
    Join Date
    Oct 2004
    Location
    A Vastly Superior Place
    Posts
    1,726
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: phpMyAdmin help...

    Quote Originally Posted by S3NTYN3L
    Thanx Zui...

    Well, I must be a complete retard... I can log into my host using ftp from the command prompt but it won't let me upload anything.

    What am I doing wrong?

    I'm sorry to say I still need more hand-holding...

    Thanx for your understanding...


    What program are you using for the ftp transfer? Often those things are more complicated than they need to be.
    Clan? What Clan?
    I'm the Master. I need no Clan.

Page 1 of 2 1 2 LastLast

Bookmarks

Posting Permissions

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