Results 1 to 2 of 2

Thread: wanna partner up?

  1. #1
    Senior Member frostymarvelous's Avatar
    Join Date
    Jun 2010
    Location
    Accra, Ghana.
    Posts
    258
    Thanks
    3
    Thanked 20 Times in 17 Posts
    Rep Power
    3

    Default

    I'm rewriting my community builder with some killer features as well as speeding up the code by a huge percentage.
    Unfortunately, I've got school and can't devote my full attention to it.
    If you know pdo and want to partner up, let me know.
    This is a sample from my script.
    Its just a test, but mostly, that's the way it will be.

    PHP Code:
    <?php
        $t 
    microtime(true);
    require_once( 
    'require.php' );
        
    $template_values = array( );
        
        
    list(
    $flood_control) = getSet'flood_control' );
    $cookie_namemd5SALT.getUA().$_SITE->id.'flood_control' );
    $cookie_value$flood_control time() ;


    if ( !
    isLoggedIn() ) die( 'Forbidden' );

    if ( isset(
    $_GET['sf']) )
    {
    $fid$_GET['sf'];
    $return 'forum.php?sf='.$fid;
    $table 'site_forum_subthreads';
    $parent 'site_forum_forums';
    $column'subforum';
    }
    else if ( isset(
    $_GET['mf']) )
    {
    $fid$_GET['mf'];
    $return 'forum.php?mf='.$fid;
    $table 'site_forum_threads';
    $parent 'site_forum_forums';
    $column'forum';
    }
    else die( 
    'forbidden' );
        
    try
    {
    $forum_check DB::getInstance()->prepare"SELECT title, access FROM $parent WHERE id = ? AND site = ?" );
    $forum_check->execute( array($fid$_SITE->id) );
    $forum_check $forum_check->fetchPDO::FETCH_OBJ );

    if ( !
    $forum_check ) die ( 'Error 404: Page not found' );
    else if ( 
    $_ACCESS $forum_check->access $die'Forbidden' );
    }
    catch(
    PDOException $e)
    {
    Log::addEntry$e->getMessage(), 'mysql' );
    //redirect to error page
    }


    if ( isset(
    $_POST['add']) )
    {
    if ( empty(
    $_POST['title']) || empty($_POST['body']) ) $_ERROR 'All fields are required';
    else if ( isset (
    $_COOKIE[$cookie_name]) && (time() < $_COOKIE[$cookie_name] )  ) $template_values['_ERROR']['message'] = "You have to wait for $flood_control seconds before you can post again.";
    else
    {
    try
    {
    $title utf8_htmlentitiestrim($_POST['title']) );
    $body utf8_htmlentitiestrim($_POST['body']) );

    $insert_query DB::getInstance()->prepare"INSERT into $table ($column, title, body, user, username) VALUES ( ?, ?, ?, ?, ?)" );
    $insert_query->execute( array($fid$title$body$_SESSION['site_user_id'], $_SESSION['site_user_username'] ) );

    $_SUCCESS 'Your thread has been successfully posted';

    header'Location: '.MY_SITE_URL.'/m/site/forum/'.$return.'&msg='.urlencode($_SUCCESS) );
    setcookie($cookie_name$cookie_value);//flood control cookie
                    
                    
    DB::close();
    exit();
    }
    catch(
    PDOException $e)
    {
    Log::addEntry$e->getMessage(), 'mysql' );
    $template_values['_ERROR']['message'] = 'There was an error, please try again.<br />If this continues, please contact the <a href="mailto:sfroelich01@gmail.com">webmaster</a>.';
    }
    }
    }
    //end of post check
        
        
        
    $template_values['title'] = $_SITE->sitename.' | New Thread - '.$forum_check->title;
        
    $template_values['return_url'] = $return;
        
        
    $template = new PclTemplate();


        
    $template->parseString('
    <!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title><!--(token:title)--></title>
    <link href="../../css/main.css" rel="stylesheet" type="text/css" media="handheld,screen" />
    <link href="../../css/forum.css" rel="stylesheet" type="text/css" media="handheld,screen" />
    </head>

    <body>
    <div class="container">
        <div class=" header">
      <table>
                <tr>
                    <td class="left"><a href="../../s/index.php"><img src="../../images/logo.png" alt="Logo" /></a></td>
                </tr>
            </table>
        <!-- end .header-->
        </div>
    <!--(if:_ERROR)--> 
    <div class=\"error\"><!--(token:message)--></div> 
    <!--(endif)-->
        <div class="content">
    <div class="form-panel">
            <form action="" method="post" name="thread_form" class="thread_form">
                    <label for="thread_title">Title</label><br  />
                <input name="title" type="text" id="thread_title" accesskey="1" tabindex="1" size="" maxlength="" required="required" /><br />
                     
                    <label for="thread_body">Body</label><br  />
                    <textarea name="body" type="" id="thread_body" accesskey="2" tabindex="2" required="required" ></textarea><br  />              
                    <input name="add" type="submit" value="Add" accesskey="3" tabindex="3" />
                    
                    <a href="<!--(token:return_url)-->">Cancel</a>
                </form>
            <!--end .form-panel-->
            </div>
            
    <!-- end .content-->
        </div>
        
        <div class="blank footer">
        <!-- end .footer-->
        </div>
    <!-- end .container-->
    </div>
    </body>
    </html>'
    );
        echo 
    $template->generate$template_values'string' );
        
        echo 
    microtime(true) - $t;
    ?>
    Template designers are welcome. There is to be a pc and wap version.
    Last edited by frostymarvelous; 07-02-11 at 19:20.

  2. #2
    Member tkreturns's Avatar
    Join Date
    Mar 2009
    Posts
    98
    Thanks
    7
    Thanked 51 Times in 15 Posts
    Rep Power
    5

    Default

    I can make templates, logos and anything related to graphics. viz., Buttons etc.

    and can provide you some ideas too, work too..

    pm me

    we can partner up mate.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Just wanna ask
    By Jervy in forum General Discussion
    Replies: 3
    Last Post: 10-12-10, 20:36
  2. [HELP] I wanna count just UNIQUE visitors
    By sladex in forum Coding Forum
    Replies: 10
    Last Post: 31-01-10, 14:43
  3. wanna buy all the best books to make u a a1 web developer?
    By xcoderx in forum Design - Templates - Graphics
    Replies: 7
    Last Post: 02-01-10, 11:12
  4. partner neede
    By foxofdeath in forum Sites / Links
    Replies: 7
    Last Post: 01-10-09, 19:37
  5. I Wanna Buy
    By m0ni in forum Coding Forum
    Replies: 3
    Last Post: 05-03-09, 01:40

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

SEO by vBSEO

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19