Sitemap generator script for photos [closed] - php

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 8 years ago.
This question appears to be off-topic because it lacks sufficient information to diagnose the problem. Describe your problem in more detail or include a minimal example in the question itself.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Improve this question
I'm working on a sitemap script but now I need to know how I can scan all my photo's since they are in different folders (I'm working with albums)
All my images that I want to get into the sitemap are in this directory: public_html/Albums/{Albumname}/{photo name}
How can I do this?

If the location in not remote then you can try the following:
<?php
$path = realpath('public_html/Albums');
foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator($path)) as $filename)
{
echo "$filename\n";
}
?>
You can generate the URL accordingly in the loop.

Related

Calling Drupal URL from another server using php [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 8 years ago.
This question appears to be off-topic because it lacks sufficient information to diagnose the problem. Describe your problem in more detail or include a minimal example in the question itself.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Improve this question
I am trying to call drupal 6 URL from my local system, that URL will generate a xml file.
My system does not have drupal intallation. I tried file_get_content("www.abc.com") but it does not write my xml file but when I try to run the url normally it runs and xml file gets generated.
Thanks in advance
You can use sockets or just file_get_contents, like
$homepage = file_get_contents('http://www.example.com/');
echo $homepage; // $homepage contains server response without headers

How do I get activated plugin list in wordpress plugin development? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
Is there any way to get all activated plugin list in wordpress codex .
i used this
get_option('active_plugins');
this return the plugin file path. I want the name. Because sometimes file name is different with the actual plugin name.
I got the answer
$apl=get_option('active_plugins');
$plugins=get_plugins();
$activated_plugins=array();
foreach ($apl as $p){
if(isset($plugins[$p])){
array_push($activated_plugins, $plugins[$p]);
}
}
//This is the $activated_plugins information

file_put_contents in the folder below [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I'm making a file creating script in php using file_put_contents, so how do you place a file to the directory below?
For example the script is in localhost:8080/favicon/ and I want to place the file in localhost:8080, how can this be done?
$dest = __DIR__ . '/../filename';
file_put_contents($dest, $data);
See http://php.net/manual/language.constants.predefined.php
fclose(fopen(path_to_your_file_like_C:\abc\,"a"));
for more info go here.

Resource ID #2? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
Why when it displays does it say Resource id #2?
All I am doing is fetching a simple number (0) out of a .txt file:
$num = fopen('qnum/qnum.txt', 'r');
echo $num;
You are not actually reading the file. You are only opening it and acquiring a reference to the file. You have to add more code (e.g. something along the lines of the answers to this question) to read the contents of the file.

create php file to check database frequently [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
How I can create a php file to check mysql database if there is new row inserted ?
any article for this ?
thanks in advance.
Use google cloud messaging and modify your insert script
https://developer.android.com/google/gcm/index.html
the google site has API examples

Categories