Addition of a few features to Directory listing - php

I'm a newbie to web development. I'm using the directory listing tool provided by http://www.directorylister.com/. However, I managed to make a few tweaks here and there, however, I'm stuck here.
I need to create the following 3 buttons that do the following:
Create directory: This will create a directory(I get an option to name it before creation) in the current path I'm in. Current path/directory is mentioned at top left.
Upload file: This will give me the option to upload files current directory I'm in.
Sync: This will basically just run a bash script I have made.
I managed to create buttons using Create Directory , however, I was facing issues making it work right.
Any kind of help would be really helpful.
Regards,
Rohan Dsouza

Related

How to create an index-file for Xampp

I apologize in advance if this issue has been posted before. My problem is that my programmer had to bail on my project due to personal reasons and left me alone with a 95% finished site. I have some basic experience with ASP classic but PHP is fairly new to me.
FireFTP scr_shot: https://www.dropbox.com/s/9lws1u0sl8k93rg/fireftp_scr_shot.jpg
To shorten it up; (with Xampp installed) I have downloaded my site to the hard-drive and is now trying to get it work on 'localhost'. Immediately I sense the absence of an index-file.
Do I need to make one myself for the use in localhost? In that case, what am I looking for?
Thank you in advance.
First if you want to make an index-file of your current website, you have to put all your pages in a folder in
xampp/htdocs/
e.g
C:\Xampp\htdocs\mywebsite
then after you make a directory just visit the url like this:
localhost/mywebsite
, remember to put an index file inside the mywebsite folder.
It turned out that there was a MYSQL-database behind the site which I had no idea about or any knowledge of how to get around.
I had the database taken off and written the code into the site-files.
Afterwards everything worked as laid out above comments.

Magento 1.7.0.2 - Image type and information need to be specified for each store view

I have Magento 1.7.0.2 installed and running. When I go to add a new product I am getting the "Image type and information need to be specified for each store view."
Steps I Have Tried:
1) Navigate to System -> Manage stores
2) Click one each of your store views, and choose “disable”
3) Save
4) Clear all cache
5) re-enable your store view
6) clear cache again
Did that about 6 times. I also tried adding a store view then doing all those steps again and that didn't work, so I deleted the store view I created since this site only needs one store view.
Other things I tried.
1) Disable all 3rd Party Extensions
2) Go to Stock Theme
3) Renaming the .htaccess in the media folder.
Does anyone have other suggestions on what to try?
EDIT: The Browse and Upload buttons weren't showing up as well, and apparently it had nothing to do with the message I am getting. After Nick Darley's help I was able to get the buttons to appear but the message is still there, which I can live with.
I had the same issue in Magento CE 1.9 and all other answers did not work. I ended up going to skin/adminhtml/default/default/media and changing the permissions for uploader.swf and that worked for me. Also, make sure you have the latest version of Flash installed for your browser.
So after looking into the issues with the provided credentials I see this error.
I also looked into your configuration and see that you are running magento in a sub-directory. I see you aren't having any other issues from the looks of it so I would just suggest a quick fix.
Create a new folder in the root called skin and then upload a copy of the adminhtml from your server. After that, that should resolve your issue with it not being able to find the file.
"Image type and information need to be specified for each store view."
For those who are getting this error please try change flash setting or run in different browser. It works for me. Thanks
Image type and information need to be specified for each store view:
Go to File structure root/media/ dhl
Cut or delete the “dhl” folder from there.
Clear cache from Admin Panel and now do upload the images
Hope, Its working good.
According to the Magento user manual, before adding images to the Magento Gallery, one must select the store view which it shows on the top left as a dropdown. That would make perfect sense.
I am running Magento with shared hosting on GoDaddy and I do not see a dropdown for that view although I have found that dropdown in another place. Are you using Magento Shared Hosting on GoDaddy? According to http://www.submitdigital.com/questions/magento-1-7-image-upload-issues-help-image-type-and-information-need-to-be-specified-for-each-store-view/ it may be an issue specific to the way it is being installed or hosted.
Check if your internet firewall is not blocking the execution of audio and video files, because it needs to execute the files bellow:
/skin/adminhtml/default/default/media/flex.swf
/skin/adminhtml/default/default/media/uploader.swf
/skin/adminhtml/default/default/media/uploaderSingleswf
Hope it helps.

Exposing a web service through WordPress

I'm creating a new plugin for WordPress that requires an outside website to use a web service. For instance, if there are two sites, A and B, the plugin will be installed on A with all associated data stored in the WordPress database for Site A. Site B will use the web service to grab data in XML format from Site A.
Is this possible? What would be the most secure way of pulling this off?
I could just have the web service as a PHP file in my plugin, but that's going to require the outside domain to hit something like:
http://www.example.com/wp-content/plugins/plugin-folder/web-service.php. It seems like a bad idea to expose the level of depth of the WordPress setup.
I could have my plugin create a few files in the root so that the web service call would be to http://www.example.com/web-service.php, but having my plugin install stuff outside of the plugin directory also seems like a bad practice.
Another thought: Could I put the file in my plugin folder, but add a line in file .htaccess to make http://www.example.com/web-service.php go to it?
What is the best, most secure way to go about this?
I would set up a rewrite rule in .htaccess to let the user get to your code without knowing where it is. I don't think there is an easy way to add specific routes to the WordPress front controller, but you could see if there is an action or filter to do that.
Here's a post on adding routes: How can I create custom URL routes?
In my personal opinion, if I installed a WP plugin and you created a new file in my root directory, I would either delete the file or the plugin all together. I would also try to avoid adding a .htaccess file. This would again make me suspicious.
What I would do is, upon install ping a file on Site B (your site) that captures the location of the plugin folder on Site A (their site), because WP might be installed inside of a directory and not at the root. Then you know where the "web-service.php" file is located. Then you can just hit that file whenever you need. There is no reason for .htaccess rules, or creation of new files.
Just a suggestion :)

How to include file from seperate remote folder in Netbeans (PHP Development)

I have a PHP project setup in Netbeans (v6.8) where all the PHP files are on a remote server and in a single directory. Whenever I save files locally they are updated on the remote server via SFTP.
I now need to edit a remote JavaScript file to add some jQuery logic but the file is located within a different directory on the webserver. How to I add this JavaScript file such that when it is saved or updated it is transferred to it's own location on the server?
When I attempt to create the file locally within NetBeans it saves to the same directory as my PHP files. I would like to be able to continue using NetBeans rather than doing this all manually using an SFTP client and a text editor. Thanks in advance.
Since you're not getting any answers I'll offer a limited suggestion. I use netbeans, but not to automatically upload like you're doing so I may be way off here.
It sounds like you would either need to change your project to have a larger directory structure that would contain everything for this to work like you want it to. Gan you go up a level or two in the directory structure, and add containing folders in your local project to match?
The other option might be to create a second project for the javascript directory, and set that to go were it needs to go. You can create "project groups" in the project view which you can use to link them together. I know this is probably not ideal, but is hopefully easier than doing your uploads manually.

Multi-site File Manager in PHP: Update a single file in multipe sites w/one click?

I have a hosting (hostgator) account with a master directory and multiple subdirectories, each representing a www address. I'd like to know if its possible to create an interface in php that would allow me to update a given file (say, header.php) in a specific folder (my custom wordpress theme which resides in each site) which will be the same in every site.
I currently have to do this via FTP, but its cumbersome b/c I have to open each directory and copy the file to it. So if I have 30 sites to update, its very time consuming. i'd like to just have a list of sites with a checkbox beside each of them (and a "select all" toggle) and run the update on all sites in one click)
Thanks for your input!
PS: I know there are probably chron scripts or interfaces that can do this, but I'll be creating a scriptable (PHP) solution I can package up and send to someone and it just works and is brain-dead simple to use.
Yes, it's possible, you can modify files using PHP's file functions and you can communicate what to update through sockets.
It would be fairly complicated to implement though so I'm not sure what you're asking for.. Yes it's possible but I doubt someone here will give you a copy&paste solution. Do you have a more specific question?
EDIT: an easier solution would be to have a SVN repository so you can simply do it with one line of PHP code:
`svn update`
Any reason you're not using WordPress MU? With it and the child theme functionality built into recent versions of WordPress, your life might be a lot easier.
Yes:
I currently have to do this via FTP,
but its cumbersome b/c I have to open
each directory and copy the file to
it. So if I have 30 sites to update,
its very time consuming. i'd like to
just have a list of sites with a
checkbox beside each of them (and a
"select all" toggle) and run the
update on all sites in one click)
Basically you need to script those FTP actions and provide some logic as to what path and what files. You can then style the entire thing with a simple front end, listing your sites with a checkbox to select.
Doesn't seem difficult, just have to get the FTP path traversal working and file cp'ing down.
Have a look at Phing and search Google for deployment with PHP
If you are hosting multiple WP sites, you really should use WPMU.
I've implemented Uploadify for single / multiple file upload. Works great.
I also use Wordpress.
if its just the header.php and you dont have svn (you could setup an hook which would copy it for you to the right place)
you could write a bash script if you have ssh access

Categories