Example #1
0
    $_POST['display']=mysql_real_escape_string(stripslashes($_POST['display']));
    if(mysql_query("INSERT INTO ".$db_prefix."bbs (bbs,title,postname,show_id,display) VALUES ('".$_POST['bbs']."','".$_POST['title']."','".$_POST['postname']."','".$_POST['show_id']."','".$_POST['display']."')"))
     {
     echo 'Successfully created<br />'."\n";
     echo 'Go to BBS: <a href="../'.$_POST['bbs'].'/index.html">'.$_POST['title'].'</a><br />'."\n";
     if(!file_exists('../'.$_POST['bbs'].'/')) mkdir('../'.$_POST['bbs'].'/',0777);
     if(!file_exists('../'.$_POST['bbs'].'/.htaccess'))
      {
      $fp=fopen('../'.$_POST['bbs'].'/.htaccess','w');
      fwrite($fp,'DirectoryIndex index.html');
      fclose($fp);
      }
     require 'page_elements.php';
     $fp=fopen("../".$_POST['bbs']."/index.html",'w');
     fwrite($fp,head($bbs_name,$_POST['title']));
     fwrite($fp,index_display($bbs_name,$_POST['title'],$bbs['display']));
     fwrite($fp,index_menu($_POST['bbs'],$db_prefix,$menu_n,$index_n));
     fwrite($fp,index($_POST['bbs'],$db_prefix,$index_posts_n,$index_n,$_POST['postname'],$_POST['show_id']));
     fwrite($fp,form($_POST['bbs']));
     fwrite($fp,$foot);
     fclose($fp);

     $fp=fopen("../".$_POST['bbs']."/subback.html",'w');
     fwrite($fp,$head);
     fwrite($fp,index_menu($_POST['bbs'],$db_prefix));
     fwrite($fp,$foot);
     fclose($fp);
     }
    }
   ?>
Create BBS:
Example #2
0
                    break;
                case 'rss2':
                default:
                    header('Content-type: application/rss+xml');
                    $module = SHARED_TPLS . 'rss.tpl';
            }
        }
        index_showposts($params, $module);
    }
    $params['fullparse'] = true;
    $fpdb->query($params);
    $q =& $fpdb->getQuery();
    list($id, $e) = $q->peekEntry();
    /* no entry found : 404 */
    if (!$e && $can404) {
        $module = index_404error();
    }
    return $module;
}
function index_display()
{
    global $smarty;
    $module = index_main();
    theme_init($smarty);
    $smarty->display($module);
    unset($smarty);
    do_action('shutdown');
}
system_init();
index_display();