NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Programming
Reload this Page Quick Find & Replace Question!

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.

Advanced Search
5 members in live chat ~  


Reply
 
LinkBack Thread Tools
Old 05-05-2009, 09:20 AM THREAD STARTER               #1 (permalink)
NamePros Regular
 
Something Vague's Avatar
Join Date: Mar 2006
Posts: 887
Something Vague is a jewel in the roughSomething Vague is a jewel in the roughSomething Vague is a jewel in the rough
 



Quick Find & Replace Question!


Hi, I have a XML page here. Basically, I need to change the AA! (1) for every file to (2) all the way through to (2611). Is there any Find and Replace formula I could use, instead of doing this manually? Or, some simple PHP script I could incorperate into this XML page? I would hate to have to waste 5 hours editing these numbers...




PHP Code:
<?xml version="1.0" encoding="UTF-8"?>
<simpleviewerGallery maxImageWidth="480" maxImageHeight="480" textColor="0xFFFFFF" frameColor="0xffffff" frameWidth="20" stagePadding="40" thumbnailColumns="3" thumbnailRows="3" navPosition="left" title="SimpleViewer Title" enableRightClickOpen="true" backgroundImagePath="" imagePath="" thumbPath="">
<image>
    <filename>AA! (1).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>
<image>
    <filename>AA! (2).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>
<image>
    <filename>AA! (3).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>
<image>
    <filename>AA! (4).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>
<image>
    <filename>AA! (5).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>
<image>
    <filename>AA! (6).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>
<image>
    <filename>AA! (7).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>
<image>
    <filename>AA! (8).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>
<image>
    <filename>AA! (9).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>
<image>
    <filename>AA! (1).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>
<image>
    <filename>AA! (1).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>
<image>
    <filename>AA! (1).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>
<image>
    <filename>AA! (1).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>
<image>
    <filename>AA! (1).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>
<image>
    <filename>AA! (1).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>

<image>
    <filename>AA! (1).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>
<image>
    <filename>AA! (1).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>
<image>
    <filename>AA! (1).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>
<image>
    <filename>AA! (1).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>
<image>
    <filename>AA! (1).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>
<image>
    <filename>AA! (1).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>
<image>
    <filename>AA! (1).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>
<image>
    <filename>AA! (1).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>
<image>
    <filename>AA! (1).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>
<image>
    <filename>AA! (1).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>
<image>
    <filename>AA! (1).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>
<image>
    <filename>AA! (1).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>
<image>
    <filename>AA! (1).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>
<image>
    <filename>AA! (1).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>
<image>
    <filename>AA! (1).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>
<image>
    <filename>AA! (1).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>
<image>
    <filename>AA! (1).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>
<image>
    <filename>AA! (1).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>
<image>
    <filename>AA! (1).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>
<image>
    <filename>AA! (1).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>

<image>
    <filename>AA! (1).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>
<image>
    <filename>AA! (1).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>
<image>
    <filename>AA! (1).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>
<image>
    <filename>AA! (1).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>
<image>
    <filename>AA! (1).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>
<image>
    <filename>AA! (1).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>
<image>
    <filename>AA! (1).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>
<image>
    <filename>AA! (1).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>
<image>
    <filename>AA! (1).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>
<image>
    <filename>AA! (1).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>
<image>
    <filename>AA! (1).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>
<image>
    <filename>AA! (1).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>
<image>
    <filename>AA! (1).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>
<image>
    <filename>AA! (1).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>
<image>
    <filename>AA! (1).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>
<image>
    <filename>AA! (1).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>
<image>
    <filename>AA! (1).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>
<image>
    <filename>AA! (1).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>
<image>
    <filename>AA! (1).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>
<image>
    <filename>AA! (1).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>

<image>
    <filename>AA! (1).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>
<image>
    <filename>AA! (1).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>
<image>
    <filename>AA! (1).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>
<image>
    <filename>AA! (1).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>
<image>
    <filename>AA! (1).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>
<image>
    <filename>AA! (1).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>
<image>
    <filename>AA! (1).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>
<image>
    <filename>AA! (1).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>
<image>
    <filename>AA! (1).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>
<image>
    <filename>AA! (1).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>
<image>
    <filename>AA! (1).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>
<image>
    <filename>AA! (1).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>
<image>
    <filename>AA! (1).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>
<image>
    <filename>AA! (1).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>
<image>
    <filename>AA! (1).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>
<image>
    <filename>AA! (1).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>
<image>
    <filename>AA! (1).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>
<image>
    <filename>AA! (1).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>
<image>
    <filename>AA! (1).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>
<image>
    <filename>AA! (1).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>

<image>
    <filename>AA! (1).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>
<image>
    <filename>AA! (1).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>
<image>
    <filename>AA! (1).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>
<image>
    <filename>AA! (1).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>
<image>
    <filename>AA! (1).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>
<image>
    <filename>AA! (1).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>
<image>
    <filename>AA! (1).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>
<image>
    <filename>AA! (1).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>
<image>
    <filename>AA! (1).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>
<image>
    <filename>AA! (1).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>
<image>
    <filename>AA! (1).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>
<image>
    <filename>AA! (1).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>
<image>
    <filename>AA! (1).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>
<image>
    <filename>AA! (1).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>
<image>
    <filename>AA! (1).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>
<image>
    <filename>AA! (1).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>
<image>
    <filename>AA! (1).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>
<image>
    <filename>AA! (1).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>
<image>
    <filename>AA! (1).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>
<image>
    <filename>AA! (1).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>

<image>
    <filename>AA! (1).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>
<image>
    <filename>AA! (1).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>
<image>
    <filename>AA! (1).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>
<image>
    <filename>AA! (1).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>
<image>
    <filename>AA! (1).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>
<image>
????: NamePros.com http://www.namepros.com/programming/580601-quick-find-and-replace-question.html
    <filename>AA! (1).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>
<image>
    <filename>AA! (1).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>
<image>
    <filename>AA! (1).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>
<image>
    <filename>AA! (1).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>
<image>
    <filename>AA! (1).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>
<image>
    <filename>AA! (1).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>
<image>
    <filename>AA! (1).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>
<image>
    <filename>AA! (1).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>
<image>
    <filename>AA! (1).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>
<image>
    <filename>AA! (1).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>
<image>
    <filename>AA! (1).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>
<image>
    <filename>AA! (1).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>
<image>
    <filename>AA! (1).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>
<image>
    <filename>AA! (1).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>
<image>
    <filename>AA! (1).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>

<image>
    <filename>AA! (1).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>
<image>
    <filename>AA! (1).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>
<image>
    <filename>AA! (1).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>
<image>
    <filename>AA! (1).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>
<image>
    <filename>AA! (1).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>
<image>
    <filename>AA! (1).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>
<image>
    <filename>AA! (1).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>
<image>
    <filename>AA! (1).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>
<image>
    <filename>AA! (1).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>
<image>
    <filename>AA! (1).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>
<image>
    <filename>AA! (1).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>
<image>
    <filename>AA! (1).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>
<image>
    <filename>AA! (1).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>
<image>
    <filename>AA! (1).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>
<image>
    <filename>AA! (1).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>
<image>
    <filename>AA! (1).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>
<image>
    <filename>AA! (1).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>
<image>
    <filename>AA! (1).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>
<image>
    <filename>AA! (1).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>
<image>
    <filename>AA! (1).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>

<image>
    <filename>AA! (1).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>
<image>
    <filename>AA! (1).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>
<image>
    <filename>AA! (1).jpg</filename>
    <caption>Free Avatars!/caption>    
????: NamePros.com http://www.namepros.com/showthread.php?t=580601
</image>
<image>
    <filename>AA! (1).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>
<image>
    <filename>AA! (1).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>
<image>
    <filename>AA! (1).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>
<image>
    <filename>AA! (1).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>
<image>
    <filename>AA! (1).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>

</simpleviewerGallery>
__________________
http://www.twitter.com/chrisrwilliams -- mention you're a NP'er, and i'll follow you back immediately
Something Vague is offline   Reply With Quote
Old 05-05-2009, 10:20 AM   #2 (permalink)
Senior Member
 
BeZazz's Avatar
Join Date: Aug 2006
Location: Australia
Posts: 1,362
BeZazz has much to be proud ofBeZazz has much to be proud ofBeZazz has much to be proud ofBeZazz has much to be proud ofBeZazz has much to be proud ofBeZazz has much to be proud ofBeZazz has much to be proud ofBeZazz has much to be proud ofBeZazz has much to be proud ofBeZazz has much to be proud of
 




I'm half asleep so I may be missing something obvious but cant you just use the replace function of a text editor?
__________________
Dolphins
OMFG!
BeZazz [US/UK] Low Cost Friendly Hosting 33% Discount Coupon 33-NPS
BeZazz is offline   Reply With Quote
Old 05-05-2009, 10:32 AM THREAD STARTER               #3 (permalink)
NamePros Regular
 
Something Vague's Avatar
Join Date: Mar 2006
Posts: 887
Something Vague is a jewel in the roughSomething Vague is a jewel in the roughSomething Vague is a jewel in the rough
 



Absolutely, but, I need to replace each number with a something different. So I would be using the replace function about 2600 times.

Each (1) needs to be replaced with (2) then (3) then (4) etc
__________________
http://www.twitter.com/chrisrwilliams -- mention you're a NP'er, and i'll follow you back immediately
Something Vague is offline   Reply With Quote
Old 05-05-2009, 10:37 AM   #4 (permalink)
Senior Member
 
BeZazz's Avatar
Join Date: Aug 2006
Location: Australia
Posts: 1,362
BeZazz has much to be proud ofBeZazz has much to be proud ofBeZazz has much to be proud ofBeZazz has much to be proud ofBeZazz has much to be proud ofBeZazz has much to be proud ofBeZazz has much to be proud ofBeZazz has much to be proud ofBeZazz has much to be proud ofBeZazz has much to be proud of
 




Ahh ok.

If you haven't found the answer by tomorrow (currently 3:35am here) and still looking for a way to do it. I will write up some php for you. Just PM me if interested.
__________________
Dolphins
OMFG!
BeZazz [US/UK] Low Cost Friendly Hosting 33% Discount Coupon 33-NPS
BeZazz is offline   Reply With Quote
Old 05-05-2009, 10:39 AM THREAD STARTER               #5 (permalink)
NamePros Regular
 
Something Vague's Avatar
Join Date: Mar 2006
Posts: 887
Something Vague is a jewel in the roughSomething Vague is a jewel in the roughSomething Vague is a jewel in the rough
 



Thanks, I really appreciate that
__________________
http://www.twitter.com/chrisrwilliams -- mention you're a NP'er, and i'll follow you back immediately
Something Vague is offline   Reply With Quote
Old 05-05-2009, 10:58 AM   #6 (permalink)
NamePros Regular
 
qbert220's Avatar
Join Date: Jul 2007
Location: UK
Posts: 394
qbert220 is a splendid one to beholdqbert220 is a splendid one to beholdqbert220 is a splendid one to beholdqbert220 is a splendid one to beholdqbert220 is a splendid one to beholdqbert220 is a splendid one to beholdqbert220 is a splendid one to behold
 


Protect Our Planet
Code:
<?xml version="1.0" encoding="UTF-8"?>
<simpleviewerGallery maxImageWidth="480" maxImageHeight="480" textColor="0xFFFFFF" frameColor="0xffffff" frameWidth="20" stagePadding="40" thumbnailColumns="3" thumbnailRows="3" navPosition="left" title="SimpleViewer Title" enableRightClickOpen="true" backgroundImagePath="" imagePath="" thumbPath="">
<?php

for ($i = 1; $i <= 2611; $i++)
{
    echo '<image>
    <filename>AA! ('.$i.').jpg</filename>
    <caption>Free Avatars!/caption>
</image>
';
}
?>
</simpleviewerGallery>
If this is saved in a file ending with .php it should do what you want.
????: NamePros.com http://www.namepros.com/showthread.php?t=580601

If you need to use a different file extension, you'll need to make a change to your .htaccess file to use the PHP interpreter. For example:

Code:
RemoveHandler .xml
AddType application/x-httpd-php .xml
qbert220 is offline   Reply With Quote
Old 05-05-2009, 11:16 AM THREAD STARTER               #7 (permalink)
NamePros Regular
 
Something Vague's Avatar
Join Date: Mar 2006
Posts: 887
Something Vague is a jewel in the roughSomething Vague is a jewel in the roughSomething Vague is a jewel in the rough
 



Thanks so much! I'm going to try this right now. I will post back the results

---------- Post added at 02:16 PM ---------- Previous post was at 02:10 PM ----------

I edited gallery.xml with the code you wrote, and added the .htaccess in the root but it essentially acts as if there are no images in the gallery at all.

I would only assume this is because of the whole PHP code being in an XML file
__________________
http://www.twitter.com/chrisrwilliams -- mention you're a NP'er, and i'll follow you back immediately
Something Vague is offline   Reply With Quote
Old 05-05-2009, 11:34 AM   #8 (permalink)
NamePros Regular
 
qbert220's Avatar
Join Date: Jul 2007
Location: UK
Posts: 394
qbert220 is a splendid one to beholdqbert220 is a splendid one to beholdqbert220 is a splendid one to beholdqbert220 is a splendid one to beholdqbert220 is a splendid one to beholdqbert220 is a splendid one to beholdqbert220 is a splendid one to behold
 


Protect Our Planet
Is the XML file being processed by the web server? If not, rename the file so that it ends with .php, add the following to the beginning:
Code:
<?php header("Content-Type: plain/text"); ?>
then visit it in a web browser. You should then see the XML, which you could copy and paste into the XML file.
qbert220 is offline   Reply With Quote
Old 05-05-2009, 02:44 PM   #9 (permalink)
NamePros Expert
 
Peter's Avatar
Join Date: Nov 2003
Location: Scotland
Posts: 5,074
Peter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond repute
 


Child Abuse Save The Children Save The Children Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009
qbert220 that is not going to work properly. For example on the 1st run $i is going to be 1, you will replace 1 with 2, on the 2nd run $i is going to be 2.

Guess what is going to happen, the 1 you just replaced with 2 will now be replaced with 3.

You should start with 2611 and work your way down instead.
__________________
Manage your portfolio using my new Domain Portfolio Management script.
Securing Your Domain Name From Theft
Peter is offline   Reply With Quote
Old 05-05-2009, 03:00 PM   #10 (permalink)
NamePros Regular
 
qbert220's Avatar
Join Date: Jul 2007
Location: UK
Posts: 394
qbert220 is a splendid one to beholdqbert220 is a splendid one to beholdqbert220 is a splendid one to beholdqbert220 is a splendid one to beholdqbert220 is a splendid one to beholdqbert220 is a splendid one to beholdqbert220 is a splendid one to behold
 


Protect Our Planet
Originally Posted by Peter View Post
qbert220 that is not going to work properly. For example on the 1st run $i is going to be 1, you will replace 1 with 2, on the 2nd run $i is going to be 2.

Guess what is going to happen, the 1 you just replaced with 2 will now be replaced with 3.

You should start with 2611 and work your way down instead.
Then I must have misunderstood. I was not intending my code to run multiple times. I was trying to generate the output I thought the OP wanted:

Code:
<?xml version="1.0" encoding="UTF-8"?>
<simpleviewerGallery maxImageWidth="480" maxImageHeight="480" textColor="0xFFFFFF" frameColor="0xffffff" frameWidth="20" stagePadding="40" thumbnailColumns="3" thumbnailRows="3" navPosition="left" title="SimpleViewer Title" enableRightClickOpen="true" backgroundImagePath="" imagePath="" thumbPath="">
<image>
    <filename>AA! (1).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>
<image>
    <filename>AA! (2).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>
<image>
    <filename>AA! (3).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>
<image>
    <filename>AA! (4).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>

...

<image>
    <filename>AA! (2611).jpg</filename>
    <caption>Free Avatars!/caption>    
</image>

</simpleviewerGallery>
qbert220 is offline   Reply With Quote
Old 05-05-2009, 03:02 PM   #11 (permalink)
NamePros Expert
 
Peter's Avatar
Join Date: Nov 2003
Location: Scotland
Posts: 5,074
Peter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond repute
 


Child Abuse Save The Children Save The Children Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009
Sorry ignore my last post. I forgot to notice you were in fact echo'ing the data.
__________________
Manage your portfolio using my new Domain Portfolio Management script.
Securing Your Domain Name From Theft
Peter is offline   Reply With Quote
Old 05-06-2009, 09:46 PM THREAD STARTER               #12 (permalink)
NamePros Regular
 
Something Vague's Avatar
Join Date: Mar 2006
Posts: 887
Something Vague is a jewel in the roughSomething Vague is a jewel in the roughSomething Vague is a jewel in the rough
 



I tried your suggestion again, however it still did not work. I am completely puzzled! Instead of reading each file, maybe I could just find a way to automatically add the entire folder. I feel that might be harder to code.
__________________
http://www.twitter.com/chrisrwilliams -- mention you're a NP'er, and i'll follow you back immediately
Something Vague is offline   Reply With Quote
Old 05-06-2009, 10:45 PM   #13 (permalink)
DNMedia.com
 
Michael's Avatar
Join Date: Jul 2007
Location: Maryland
Posts: 1,842
Michael has a reputation beyond reputeMichael has a reputation beyond reputeMichael has a reputation beyond reputeMichael has a reputation beyond reputeMichael has a reputation beyond reputeMichael has a reputation beyond reputeMichael has a reputation beyond reputeMichael has a reputation beyond reputeMichael has a reputation beyond reputeMichael has a reputation beyond reputeMichael has a reputation beyond repute
 


Breast Cancer Cancer Survivorship Myanmar Relief Parkinson's Disease Child Abuse Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009
It's easier to just write a script to rebuild the file, instead of trying to correct the file.

http://dnmedia.com/cwn_xml.xml
Michael is offline   Reply With Quote
Old 05-07-2009, 08:02 AM THREAD STARTER               #14 (permalink)
NamePros Regular
 
Something Vague's Avatar
Join Date: Mar 2006
Posts: 887
Something Vague is a jewel in the roughSomething Vague is a jewel in the roughSomething Vague is a jewel in the rough
 



Michael, you just blew my mind. Thank you so much! And thank you qbert220 and Peter too, I really appreciate the efforts! Amazing!
__________________
http://www.twitter.com/chrisrwilliams -- mention you're a NP'er, and i'll follow you back immediately
Something Vague is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
quick question about PPC Neeb Domain Newbies 0 06-19-2007 11:14 PM
Quick CMS Question enocko Website Development 1 04-16-2007 10:39 PM
Quick domain reg question? bertwrld Domain Name Discussion 2 02-13-2005 05:22 PM
Quick Question Meilad Programming 4 06-04-2004 10:01 AM

 
All times are GMT -7. The time now is 02:29 PM.

Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger