MyBB Community Forums

Full Version: Templating system...
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
That's how my class does it as of now, if the file does not exist it uses the mysql version.
oh Toungue i havent actually gotten round to implimenting it yet.
argh it doesnt work, it not actually using the file templates. As i have altered them yet nothing happens. However if i edit them through the admin panel it changes.
errrr fixed. Updated in my first post.
Ahh i hit a snag, for some reason it only shows 1 category the original ones,I have made some more but they do not wish to show. http://www.forummods.net
I don't follow?
Okey, maybe I understand now, might be caused by include_once, try my new attachment.
yeah thanks that works amazingly, thank you so much you have been great help!
also if anyone else wants to use this i made a script that will go though the database.

<?php

  $hostname = "localhost";
  $username = "username";
  $password = "password";
  $dbname = "databasename";
  
 $nyconnect = mysql_connect($hostname, $username, $password) or die(mysql_error());
  mysql_select_db($dbname, $nyconnect) or die(mysql_error());
  
  $query = mysql_query("SELECT title, template FROM mybb_templates ");

  
  while($row = mysql_fetch_array($query)) {
    $ourFileName = $row['title'];
    $ourFileHandle = fopen($ourFileName.".html", 'w') or die("can't open file");
      fwrite($ourFileHandle, $row['template']);
    fclose($ourFileHandle);

   @chmod($ourFileName.'.html', 0777);

  }
  
?>
thats it i think
Pages: 1 2