php写的生成ubuntu自动切换壁纸xml文件

php写的生成ubuntu自动切换壁纸xml文件

<?php
/*
* 生成ubuntu自动切换壁纸xml文件
*/
//图片目录
$dir = ‘/home/yuxing/background’;

$hd = opendir($dir) or die(‘can not open dir’);
$files = array();
while($file = readdir($hd)) {
$tem = "$dir/$file";
if (is_file($tem) && in_array(strtolower(substr(strrchr($file,’.’), 1)), array(‘jpg’, ‘gif’)))
$files[] = $tem;
}
closedir($hd);
unset($file);

$xw = new xmlWriter();
$xw->openMemory();
$xw->setIndent(true);
$xw->setIndentString(‘ ‘);
$xw->startDocument(‘1.0’, ‘utf-8’);
$xw->startElement(‘background’);
$xw->startElement(‘starttime’);
$xw->writeElement(‘year’, ‘2000’);
$xw->writeElement(‘month’, ’01’);
$xw->writeElement(‘day’, ’01’);
$xw->writeElement(‘hour’, ’00’);
$xw->writeElement(‘minute’, ’00’);
$xw->writeElement(‘second’, ’00’);
$xw->endElement();
$count = count($files);
for ($i=0; $i<$count; $i++) {
$xw->startElement(‘static’);
//$xw->writeElement(‘duration’, ‘1795.0’);
$xw->writeElement(‘duration’, ‘30.0’);
$xw->writeElement(‘file’, $files[$i]);
$xw->endElement();
$xw->startElement(‘transition’);
$xw->writeElement(‘duration’, ‘5’);
$xw->writeElement(‘from’, $files[$i]);
$xw->writeElement(‘to’, isset($files[$i+1]) ? $files[$i+1] : $files[0]);
$xw->endElement();
}
$xw->endElement();
$xml = $xw->outputMemory(true);
//生成文件
$hd = fopen($dir . "/yuxing.xml", ‘wb’);
fwrite($hd, $xml);
fclose($hd);
echo ‘ok’;

波比源码 – 精品源码模版分享 | www.bobi11.com
1. 本站所有资源来源于用户上传和网络,如有侵权请邮件联系站长!
2. 分享目的仅供大家学习和交流,您必须在下载后24小时内删除!
3. 不得使用于非法商业用途,不得违反国家法律。否则后果自负!
4. 本站提供的源码、模板、插件等等其他资源,都不包含技术服务请大家谅解!
5. 如有链接无法下载、失效或广告,请联系管理员处理!
6. 本站资源售价只是赞助,收取费用仅维持本站的日常运营所需!
7. 本站源码并不保证全部能正常使用,仅供有技术基础的人学习研究,请谨慎下载
8. 如遇到加密压缩包,请使用WINRAR解压,如遇到无法解压的请联系管理员!

波比源码 » php写的生成ubuntu自动切换壁纸xml文件

166 评论

  1. indomethacin online buy indocin order amoxicillin 500mg without prescription

  2. provigil online order Cialis in usa order acetazolamide 250 mg without prescription

  3. terazosin online buy actos uk purchase sulfasalazine online

  4. generic benicar 20mg benicar for sale acetazolamide 250mg brand

  5. dapsone without prescription avlosulfon sale aceon 4mg pill

  6. order cialis for sale viagra 50mg pill sildenafil over counter

  7. buy generic glucophage 1000mg cialis 40mg drug generic tadalafil

  8. buy zyprexa pills valsartan uk valsartan 160mg oral

  9. dissertation writers online poker game online poker real money

  10. purchase levitra sale medrol 8mg pills buy methylprednisolone 4 mg online

  11. tadalafil 20mg oral viagra 25 mg sildenafil 100mg england

  12. order tadalafil 10mg pills cialis 5mg ca overnight delivery for viagra

  13. xenical over the counter diltiazem tablet acyclovir for sale online

  14. colchicine 0.5mg sale best casinos free poker online games

  15. metronidazole 200mg price augmentin usa bactrim oral

  16. cefuroxime 500mg price robaxin price order methocarbamol sale

  17. order prednisone 40mg pills vermox cost order vermox without prescription

  18. purchase tiotropium bromide for sale terazosin us buy terazosin 1mg for sale

  19. montelukast 10mg for sale buy viagra 100mg usa viagra overnight

  20. buy nifedipine 10mg online cheap aceon cheap allegra 120mg cheap

  21. real money slots free spins no deposit online slots online blackjack for real money usa

  22. brand tadacip plavix 75mg us buy trimox 250mg without prescription

  23. nexium 20mg cheap cheap nexium furosemide for sale

  24. compare and contrast thesis statement example thesis paragraph thesis conclusion example

  25. Everything is very open and very clear explanation of issues. was truly information. Click on the Keyword to Enter the Website. Wonodd

  26. does escitalopram damage heat lexapro withdrawals how to get your sex drive back on lexapro

  27. drugs similar to seroquel quetiapine seroquel abuse

  28. what are cephalexin capsules for cephalexin for teeth how long does it take for cephalexin to work on a toothache

  29. how long is keflex good for after expiration date https://keflexrno.com/ kidney pain back after 4 days on keflex

评论已关闭

Hi, 如果你对这款模板有疑问,可以跟我联系哦!

联系站长
赞助VIP 享更多特权,建议使用 QQ 登录
喜欢我嘛?喜欢就按“ctrl+D”收藏我吧!♡