Jump to content

ozestretch

Members
  • Posts

    237
  • Joined

  • Last visited

Posts posted by ozestretch

  1. Thanks trq, made me revisit the way I was thinking. I got it to output as desired, but am wondering if it is efficient.. thoughts?

    <?php
    $output = new GetSitemap('html');
    $sitemapout = "";
    foreach($output->sitemap as $categorykey => $value){
       $sitemapout.= "
      <li><strong>".ucwords($categorykey)."</strong>
        <ul class='first'>\n";
        // loop first level pages - status = 2
        foreach($output->sitemap[$categorykey][2]['title'] as $cat2key => $cat2value){
            $sitemapout.= "         <li><a href='{$output->sitemap[$categorykey][2]['url'][$cat2key]}'>{$cat2value}</a></li>\n";
        }
        // loop second level pages - status = 1
        $l2 = 0;
        foreach($output->sitemap[$categorykey][1]['title'] as $cat3key => $cat3value){
            if($l2==0){ $sitemapout.= "          <ul class='second'>\n"; }
            $sitemapout.= "             <li><a href='{$output->sitemap[$categorykey][1]['url'][$cat3key]}'>{$cat3value}</a></li>\n";
            $l2++;
        }
        if($l2>0){ $sitemapout.= "          </ul><!--// second //-->\n"; }
        // loop third level pages - status = 0
        $l3 = 0;
        foreach($output->sitemap[$categorykey][0]['title'] as $cat4key => $cat4value){
            if($l3==0){ $sitemapout.= "              <ul class='third'>\n"; }
            $sitemapout.= "                 <li><a href='{$output->sitemap[$categorykey][0]['url'][$cat4key]}'>{$cat4value}</a></li>\n";
            $l3++;
        }
        if($l3>0){ $sitemapout.= "              </ul><!--// third //-->\n"; }
        
        $sitemapout.= "    </ul><!--// first //-->\n  </li>\n";
    // end loop
    }
    echo "<ul>";
    echo $sitemapout;
    echo "</ul>";
    ?>
    
  2. I am creating a dynamic human readable sitemap from mysql>php.

     

    the array is created with; (array structure can be altered if this is causing the grief)

    <?php
    $row['category'] = varchar; // list of 10 categories
    $row['status'] = int; // 0,1 or 2
    $row['id'] = int; // 1,2,3,4... (AI)
    // set the title for link
    $this->sitemap[$row['category']][$row['status']]['title'][$row['id']] = $row['seo_title'];
    
    // set the url for link
    $this->sitemap[$row['category']][$row['status']]['url'][$row['id']] = $row['slug'].".php";
    ?>
    

    My required output to be as;

    <ul>
      <li>category[0]
        <ul>
          // all category[0][2]
          <li><a href="category[0][2]['title']['the row id']">category[0][2]['title']['the row id']</a></li>
          etc...
          // all category[0][1]
          <ul>
            <li><a href="category[0][1]['title']['the row id']">category[0][1]['title']['the row id']</a></li>
            etc....
            // all category[0][0]
            <ul>
              <li><a href="category[0][0]['title']['the row id']">category[0][0]['title']['the row id']</a></li>
            </ul>
        </ul>
      <li>category[1]
        <ul>
      // all category[1][2]
      <li><a href="category[1][2]['title']['the row id']">category[1][2]['title']['the row id']</a></li>
      etc...
    
    

    keep in mind where caetgory[0] is a string as key, not an integer.

     

    Any ideas or questions welcomed, thanks.

  3. Hi, I am looking to redirect URLS from:

     

    mypage.php?id1=this&id2=that&id3=&id4=&id5=&id6=&id7=last

     

    to

     

    mypage--id7-id1-id2

     

    id1 alphanumeric, id2 numeric id7 (may have special chars (- + &))

     

    this is what I have tried

     

    Options +FollowSymlinks
    RewriteEngine on
    RewriteRule ^mypage-([^\n]+)--([0-9a-z]+)-([0-9]+)$ /mypage.php?id1=$2&id2=$3&id3=&id4=&id5=&id6=&id7=$1 [NC]
    
    RewriteRule ^mypage\.php\?id1=([0-9A-Za-z]+)&id2=([0-9]+)&id3=&id4=&id5=&id6=&id7=([^\n]*)$ mypage-$3--$1-$2 [R=301,NC,L]
    

     

    It handles 1 part fine, mypage--id7-id1-id2 is read as mypage.php?id1=this&id2=that&id3=&id4=&id5=&id6=&id7=last

     

    I just want it to redirect the old non SEO url then read as this is updating a site with a couple thousand pages already linked on the net.

     

    Ideas welcomed.

  4. i'm no expert, but shall offer an eye.

     

    i am pretty sure only need to register engine base etc once.

     

    also %1 should be $1 ?

     

    Options +FollowSymlinks
    RewriteEngine on
    RewriteBase /
    RewriteCond %{HTTP_HOST} ^mysite.com[NC] 
    RewriteRule ^(.*)$ http://www.mysite.com/$1 [L,R=301]
    #
    rewriteCond %{HTTP_HOST} ([^.]+)\.mysite.com [NC]
    rewriteCond %{HTTP_HOST} !^www\.mysite\.com
    rewriteRule ^$ /turf/grabpage.php?page=$1
    #
    RewriteRule ^files/([^/]+)/([^/]+) /turf/grabpage.php?page=$1&file=$2 [NC]
    

  5. This is a lead on of a previous question (which was solved but may have caused this issue)

     

    This is how I want it to operate.

     

    domain.com, domain.com/xxxx to have trailing slashes

     

    domain.com/xxxx+, domain.com/xxxx+all to not have trailing slashes

     

    www.domain.com redirect without www

     

    sub.domain.com to not inherit any rules if possible - currently redirects to actual subfolder domain.com/sub/

     

    domain.com/anyfilename.php to be domain.com/anyfilename/

     

    (go.php checks to see if database record, if not it checks for actual file/folder)

     

    <IfModule mod_rewrite.c>
    Options +FollowSymlinks
    RewriteEngine on
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} !(\.[a-zA-Z0-9]|/)$
    RewriteCond %{REQUEST_URI} ([^+])$
    RewriteCond %{REQUEST_URI} !([a-zA-Z0-9]\+(all))$
    RewriteRule (.*)$ http\:\/\/domain\.com\/$1\/ [QSA,R,L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{HTTP_HOST} !^domain\.com$ [NC]
    RewriteRule ^(.*)$ http\:\/\/domain\.com\/$1 [QSA,L,R]
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^([0-9A-Za-z]+)/?$ /go.php?id=$1 [QSA,L]
    RewriteRule ^([0-9A-Za-z]+)\+/?$ /info.php?id=$1 [L]
    RewriteRule ^([0-9A-Za-z]+)\+all/?$ /info.php?id=$1&all=1 [L]
    </IfModule>
    

     

    it all 'seems' to do as I want, except the subdomain issue :(

     

  6. Sorted - thnks corz

     

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} !(\.[a-zA-Z0-9]|/)$
    RewriteCond %{REQUEST_URI} ([^+])$
    RewriteCond %{REQUEST_URI} !([a-zA-Z0-9]\+(all))$
    RewriteRule (.*)$ http://domain.com$1/ [QSA,R=301,L]
    #
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{HTTP_HOST} !^domain.com$ [NC]
    RewriteRule ^(.*)$ http://domain.com/$1/ [QSA,L,R=301]
    

  7. thanks, unfortunately it doesn't offer what I need.

     

    domain.com

    domain.com/xxxxx to have trailing slash

     

    domain.com/xxxxx+

    and

    domain.com/xxxxx+all to have no trailing slash

     

    so far it works except the trailing slash is still added to

    domain.com/xxxxx+all

     

     

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} !(\.[a-zA-Z0-9]|/)$
    RewriteCond %{REQUEST_URI} ([^+])$
    RewriteRule (.*)$ http://domain.com/$1/ [QSA,R=301,L]
    #
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{HTTP_HOST} !^domain.com$ [NC]
    RewriteRule ^(.*)$ http://domain.com/$1/ [QSA,L,R=301]
    

  8. Currently I add trailing slash to all directories

     

    so domain.com/666 redirs to domain.com/666/

     

    I have a function that looks for '+'

    domain.com/666+

    or

    domain.com/666+all

     

    but I do not want these urls to add a trailing slash

     

    So that works fine....

     

    Issues is if a trailing slash is added (by user or whatever) at the end of a link like

    domain.com/666+/

    domain.com/666+all/

     

    I want it removed.

     

     

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} !(\.[a-zA-Z0-9]|/)$
    RewriteCond %{REQUEST_URI} ([^+-+all])$
    RewriteRule (.*)$ http://domain.com/$1/ [R=301,L]
    

     

    I would post what I tried but I kept deleting and starting over.

  9. Sorry for delay.

     

     

    // assuming the ONLY thing in the query string is the ID
    $URL = $_SERVER['QUERY_STRING']; // changed, missing ';'
    while($line = mysql_fetch_assoc($results)) {
    if (in_array($URL,$line["ID"])) // changed from ['QUERY_STRING'] to $URL
       echo "<item>" . $line["Email"] . "</item>\n";
    }
    

  10. Note to self: put Maxtor hardware on blacklist

     

    It is a seagate HDD.... just steer clear of the maxtor enclosures!

     

    Have you tried to access the drive using some other OS?

    Several different machines running xp (home sp2 and pro sp3) or vista. Same result.

     

    ripping the case and plugging the HD directly to MB is probably the only solution.

     

    I am thinking that to be the only way around it (if I want to save the data anyway)

     

    For the record, if you do enough google searches you will see is not an uncommon issue (A lot of cons about it all so you can back up with one touch of a button) personally I use software on my pc to schedule and manual back up...

     

    Mum will ask more questions when she buys computer hardware next time.

     

    To note, after reading even more on maxtor site, they say before you plug it into a new computer, you need to remove the lock or else the lock can not be removed by a secondary computer.....

     

    IS THAT LOGICAL?

     

    You place a password on an external HDD to protect the contents... and use of external hdd is to make it portable... but you can't have protection during transit as the password must be removed prior to use on secondary machines...

     

    I think I seen an invention for a square wheel once... wonder if it was conceived by the same people!?

  11. He meant accessing the files through the command prompt. Have you contacted the manufacturers about this? If it's a common problem surely asking them how to sort it would be the best solution.

     

    Basically I been told to format the drive and I can access it... <-- that was from Maxtor Support

     

     

  12. The issue is accessing the actual drive.

     

    Maxtor has software installed on the actual HDD that provides the ability to password protect not only the contents, but access of the drive itself.

     

    Basically, if you plugged my external into your pc, you wouldn't see it in 'my computer' nor in 'manage' when right clicking 'my computer'

     

    If you install maxtor software onto your pc, it asks for the password (which is stored on the external drive) and after a few tries, tells you to shutdown the external to try again.

     

    My mum (is her HDD), against my recommendations uses 4 passwords for anything, but none of them work (but no one created the password either)

     

    I am kinda stumped and google has only resulted in other people with same issues and no real solutions (except one did remove the HDD and plug it into the mobo directly)

     

    What is the DOS method?

  13. I have a maxtor one touch series 4, 1TB

     

    It has software installed for the one touch backup service (which doesn't get used)

     

    One day the bloody thing decided it required a password to access EVERYTHING on it.

     

    After many google forums searches, I found that this is a common, user uninitiated event.

     

    Basically I been told to format the drive and I can access it.... but I have months of manual photo scanned images on there, plus many other items.

     

    Basically, what are my options for recovery of the items.

     

    1) Delete partition then recover files.... but do I need to recover partition first, in which case software with password is still active

     

    2: Remove from enclosure (looks like I have to break it to get HDD out) and plug straight into SATA (will this cause the software to run still? I assumed it only activated when connected via USB)

     

    If I connect it to a computer, it does not show in my computer nor in manage when right click on my computer. If I boot up with a disc with Acronis Disk Director, it sees the drive but says it has 2 partitions, one of 6??GB the other 3??gb (the remainder) but the hard drive was only ever showing as 1 drive of 9??gb before the password appeared.

     

    If I install the Maxtor software onto my computer, then I can access the drive (well it asks for a password anyways) but still won't show in my computer. The software simply asks to enter password, or click here to delete/format the drive.

     

    Anyways, not sure if this made sense, 1 6 pack into my birthday and remembered I still had not sorted this so thought i'd ask the xperts here....

  14. $array[] = 'oZestretch hates microsoft';
    $newarrary = explode(" ",$array[0]); // where " " (a space) is the deliminator
    
    echo $newarray[0].' really, really '.$newarray[1].' all software by '.$newarray[2];
    // prints 
    oZestretch really, really hates all software by microsoft

     

    Use it in a loop or what ever you like

     

    the methods used in that post are how you can do same, I was short on time when I read your post so took a lazy way out  :shrug:

     

     

  15. Basically, I sorted this out. Somewhere in my SATA hdd, I can only assume the MBR, was defected/corrupt.

     

    Even though I ran many different MBR utils to correct this, it only changed errors that occurred.

     

    In my drawer I have a 60gb IDE with a clone of a different machine build with SP3 PRO installed.... I thought... well if it is the main SATA HDD that is causing this, try this one that works.

     

    So I installed it, turned the pc on... I forgot to boot from dvd... and windows started up... like, literally, it fired up and gave me a desktop and all... 20 minutes later and multiple "omg another new hardware found" messages it was running.

     

    1) A HDD with an OS that was from a totally different machine build... chipset and all (heck one was single core the other dual core, one agp the other pcie etc..) should not start on a machine that is no where near alike.. right? (well it did)

     

    I then cloned that HDD onto my original (broken~) SATA HDD (well on to a partition of it anyways) and booted up with that, fine.

     

    2) So SATA HDD MBR was not the issue?

     

    I then put the aforementioned 60gb IDE in and booted with same disc to install windows (it succeeded first go)

     

    So I then cloned that to original SATA HDD and started it fine.. a few hours later of reinstalling what I need, getting my configs right etc and tweaking what I wanted and didn't, is working with same hardware as I had issue with.

     

    A long way to overcome the issue... but what was the issue?

     

     

    edit: and memtest86 passed all modules

  16. Also you may think about mail()

     

    Looks to me like they're already using the mail function.

     

    yes.... is more the way they are using it that I was suggesting they review the manual

    mail($to,$fleet number,$date,$reported,$address,$number,$defect,$subject,$message,"From: ".$email.""); 

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.