自己用C++写的NextGEN Gallery批量添加照片html代码生成器
wordpress的图片功能太弱,NextGEN Gallery插件很强大,可是也不能批量插入图片
要一下次插入个20来张图片鼠标也点累死了
先上传图片NextGEN Gallery图集,缓冲完缩略图
in.txt文件第一行为新添加的图集绝对路径,此后每行为文件名
out.txt输出html代码(居中,缩略图)
接下来就是复制粘贴啦
c++代码如下:
#include
#include
#include
using namespace std;
int main(int argc, char *argv[])
{
string path,image;
ofstream fout;
ifstream fin;
fout.open("output.txt");
fin.open("in.txt");
fin >> path;
while (fin >> image){
fout << "<a href=""<br ></a> << path << image<br /> << ""><img src=""<br /> << path << "thumbs/thumbs_"<br /> << image<br /> << "" alt=" " />
<< " class='ngg-singlepic ngg-center' /></a>"
<< endl;
}
system("PAUSE");
return EXIT_SUCCESS;
}