Find Jobs
Hire Freelancers

187157 basic PHP string replacement

N/A

Completed
Posted over 16 years ago

N/A

Paid on delivery
Hi! I need a simple PHP string replacement script, that would do the following: ------------ Log in (password protection). Connect to DB Show a list of domains (Domain field in new_ss_sites table), where the field "Status" NOT "Ready". Under the list of domains display a "Build" button. When the user presses the "Build" button, the string replacement script does the following: For each record in new_ss_sites table where "Status" NOT "Ready", repeat: ---------------------------------------------------------------------------------------------------------------------- If the field Template in new_ss_sites table NOT NULL, - Fill variable "TemplateName" with it's value. - Fill variable "Folder" with value of field "FolderToCopy" ( TemplatesList table) where field TemplateName=TemplateName If the field Template in new_ss_sites table is NULL, - pick up a random record from table called TemplatesList - fill variable "TemplateName" with value of field TemplateName ( in selected record of TemplateList table). - fill variable "Folder" with value of field FolderToCopy ( in selected record of TemplateList table). Copy the contents of folder "Folder" (it's in format of complete URL) to folder "/InWork/" (located right below the current script folder). Rename the newly copied folder to value from variable "Domain". Open all ASCII files in the renamed folder (and it's sub-folders) For each record in table called like the contents of variable TemplateName, do the following: --- - Search all open files for string(s) equal to value of OriginalText field. - In case NewText NOT NULL - replace the found string(s) (OriginalText) with content of text file. - In case NewTextFromFile NOT NULL - open that file, copy it's contents and replace the found string(s) with content of that text file. - In case NewTextFromDBfield & NewTextFromDBtable NOT NULL - replace the found string(s) with content of appropriate -current- DB field. - In case NewStringFromFunction NOT NULL - execute the function, and replace the found (OriginalText) string(s) with it's output. --- (ATTENTION: both new and original strings may include several lines, with line breaks.) When all original strings are replaced, save changes that were made to ASCII files. Cut and paste the folder with all of it's content to folder "/Ready/" (located right below the current script folder). Mark the field "Status" in current record if new_ss_sites table to "Ready". Move to next record in new_ss_sites. Repeat all above steps until all records are marked "Ready". When all records in new_ss_sites are marked "Ready", send an email to ADMIN, with following contents: New sites ready to be uploaded: [login to view URL] Site category: Category field from TempSitesTable ....... (a list of all domains that were "processed" this time) Thanks!
Project ID: 1933371

About the project

1 proposal
Remote project
Active 12 yrs ago

Looking to make some money?

Benefits of bidding on Freelancer

Set your budget and timeframe
Get paid for your work
Outline your proposal
It's free to sign up and bid on jobs
Awarded to:
User Avatar
Sir, can start the project right away. Please check PMB for more details. Thank you.
$75 USD in 1 day
5.0 (172 reviews)
6.6
6.6

About the client

Flag of ISRAEL
Bat Yam, Israel
4.9
31
Payment method verified
Member since Apr 21, 2003

Client Verification

Thanks! We’ve emailed you a link to claim your free credit.
Something went wrong while sending your email. Please try again.
Registered Users Total Jobs Posted
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Loading preview
Permission granted for Geolocation.
Your login session has expired and you have been logged out. Please log in again.