Welcome to Geeklog Tuesday, August 04 2020 @ 06:44 pm EDT

Geeklog Forums

Script for easyfile plugin..


Astalas

Anonymous
I dunno if any of you have used the easyfile plugin in the past.. but if you did and then later wanted to go with a different filemanager then you probably discovered all your files are being stored as an Octstream. They still work with a different filemanager but the name is all crazy numbers based on date, ect.. blah.. blah..

Anyways heres a simple script that will restore he original names. Just had to crap it out a bit ago so I thought I'd toss it here. If anyone has a better place for this post.. feel free to relocate it there.



<?php


// Config

$dbhost = "localhost";
$dbuser = "XXXX";
$dbpass = "XXXX";
$dbname = "XXXXXX";

$path = "/path/to/files"; // No trailing slash!



mysql_connect("$dbhost", "$dbuser", "$dbpass"Wink or die(mysql_error());
mysql_select_db("$dbname"Wink or die(mysql_error());
$query = mysql_query("select fileid, filename from gl_easyfile"Wink;
while($row = mysql_fetch_array($query)){
$fileid= $row['fileid'];
$filename = $row['filename'];

echo "Working with $fileid --\n";
$x = rename("$path/$fileid","$path/$filename"Wink;
if($x==true){
echo "$filename renamed successfully./n";
}else{
echo "Something bad happened. Files not renamed.";
}



}

?>
 Quote

Status: offline

::Ben

Forum User
Full Member
Registered: 14/01/05
Posts: 1569
Location:la rochelle, France
Hi Astatalas,

Where can I found the easyfile plugin?

Thanks.

::Ben
I'm available to customise your themes or plugins for your Geeklog CMS
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 12/01/02
Posts: 13073
Location:Stuttgart, Germany
Quote by: cordiste

Where can I found the easyfile plugin?


Was that a trick question?

bye, Dirk
 Quote

Status: offline

::Ben

Forum User
Full Member
Registered: 14/01/05
Posts: 1569
Location:la rochelle, France
:doh: Yes I made a search on easyfile plugin

To much informations hide information Smile

Thank you Dirk.

::Ben
I'm available to customise your themes or plugins for your Geeklog CMS
 Quote

All times are EDT. The time is now 06:44 pm.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content