+ Reply to Thread
Page 1 of 4 123 ... LastLast
Results 1 to 10 of 33

Thread: add latest forums mod to ipb

  1. #1
    rahul2006 is offline x10 Sophmore rahul2006 is an unknown quantity at this point
    Join Date
    Oct 2005
    Location
    IN THE HELL , WANT TO JOIN THEN PM ME
    Posts
    214

    Exclamation add latest forums mod to ipb

    hi guys i
    want little help frm u i dont know how to add database in my sql and how to add a user to my sql so i want a help frm u how to add this code to my site and where i have to upload this file and what i have to add in database and i have to add this code in my ipb forums to add a latest forum script and this is the code
    //Run these two Queries in MySQL Toolbox or PHPmyAdmin
    ALTER TABLE `ibf_members` ADD `latest_posts` LONGTEXT NOT NULL AFTER `auto_track` ;
    ALTER TABLE `ibf_members` ADD `latest_post_show` MEDIUMINT( 2 ) DEFAULT '8' NOT NULL AFTER `latest_posts` ;
    //**************************//
    // open sources/UserCp.php //
    //**************************//
    ////////
    //Find//
    ////////
    case '51':
    $this->remove_forum_tracker();
    break;
    /////////////
    //Below Put//
    /////////////
    case '90':
    $this->forums_select();
    break;
    case '91':
    $this->forums_set();
    break;
    case '92':
    $this->amount_set();
    break;
    ////////
    //Find//
    ////////
    $print->do_output( array( 'TITLE' => $this->page_title, 'JS' => 1, NAV => $this->nav ) );
    }
    /////////////
    //Below Put//
    /////////////
    function forums_select()
    {
    global $ibforums, $DB, $std;
    $query = $DB->query("SELECT latest_posts, latest_post_show, id FROM ibf_members WHERE id=".$ibforums->member[id]);
    $row = $DB->fetch_row($query);
    $checkedforums = explode("," , $row[latest_posts]);
    $row[latest_post_show] == 8 ? $amount .= "<option value=8 selected>8</option>" : $amount .= "<option value=8>8</option>";
    $row[latest_post_show] == 10 ? $amount .= "<option value=10 selected>10</option>" : $amount .= "<option value=10>10</option>";
    $row[latest_post_show] == 15 ? $amount .= "<option value=15 selected>15</option>" : $amount .= "<option value=15>15</option>";
    $row[latest_post_show] == 20 ? $amount .= "<option value=20 selected>20</option>" : $amount .= "<option value=20>20</option>";
    $this->output .= $this->html->start_latest($amount);
    foreach ($ibforums->perm_id_array as $i)
    $fast .= "OR read_perms LIKE '".$i."' OR read_perms LIKE '%,".$i."' OR read_perms LIKE '".$i.",%' OR read_perms LIKE '%,".$i.",%' ";
    $query = $DB->query("SELECT f.category, c.id as cat_id, c.position as cat_position, c.name as cat_name
    FROM ibf_forums f, ibf_categories c
    WHERE c.id=f.category
    ORDER BY c.position");
    while($row = $DB->fetch_row($query)) {
    $cats[$row[cat_id]] = $row[cat_name];
    }
    $query = $DB->query("SELECT category, name, id, description, subwrap
    FROM ibf_forums
    WHERE read_perms = '*' ".$fast. "
    ORDER BY position");
    while($row = $DB->fetch_row($query)) {
    $forums[] = array( name => $row[name],
    cat => $row[category],
    id => $row[id],
    desc => $row[description],
    sub => $row[subwrap],
    );
    }
    foreach($cats as $k=>$v) {
    $printcat = 0;
    foreach($forums as $f=>$g) {
    $checked = "";
    foreach($checkedforums as $m=>$n) {
    ($n == $forums[$f][id]) ? $checked = CHECKED : "";
    }
    if($forums[$f][cat] == $k) {
    $printcat++;
    if($printcat == 1)
    $this->output .= $this->html->cat_row($v);
    $this->output .= $this->html->latest_post_row($forums[$f][name],$forums[$f][id],$forums[$f][desc],$checked);
    }
    }
    }
    $this->output .= $this->html->end_latest();

    }
    function forums_set()
    {
    global $ibforums, $DB, $print;
    $forums = $_POST[forums];
    $end = count($forums);
    $count = 1;
    foreach($forums as $k => $v) {
    if($count == $end) {
    $dbquery .= $v;
    } else {
    $dbquery .= $v . ",";
    $count++;
    }
    }
    $DB->query("UPDATE ibf_members SET latest_posts='$dbquery' WHERE id=".$ibforums->member[id]);
    $print->redirect_screen( "Latest Posts choices updated.", 'act=UserCP&CODE=90' );
    }
    function amount_set()
    {
    global $ibforums, $DB, $print;
    $amount = $_POST[show];
    $DB->query("UPDATE ibf_members SET latest_post_show='$amount' WHERE id=".$ibforums->member[id]);
    $print->redirect_screen( "Latest Posts choices updated.", 'act=UserCP&CODE=90' );
    }
    //**************************//
    // open sources/Boards.php //
    //**************************//
    ////////
    //Find//
    ////////
    $this->output .= $this->html->PageTop( $std->get_date( $ibforums->input['last_visit'], 'LONG' ) );
    /////////////
    //Below Put//
    /////////////
    //---------------------------------------
    // Latest Posts
    //---------------------------------------
    if($ibforums->member[id] !=0) {
    $query = $DB->query("SELECT latest_posts, latest_post_show FROM ibf_members WHERE id=".$ibforums->member[id]);
    $row = $DB->fetch_row($query);
    $dbquery = "forum_id in ($row[latest_posts])";
    $show = $row[latest_post_show];
    } else {
    foreach ($ibforums->perm_id_array as $i)
    $fast .= "OR f.read_perms LIKE '".$i."' OR f.read_perms LIKE '%,".$i."' OR f.read_perms LIKE '".$i.",%' OR f.read_perms LIKE '%,".$i.",%' ";
    $dbquery = "f.read_perms = '*' $fast";
    $show = 8;
    }
    if(!$row[latest_posts] && $ibforums->member[id] !=0) {
    $post_data .= "<tr bgcolor=#E4EAF2>
    <td align=center colspan=3>You have no forums selected. Select them from your UserCP.</td>
    </tr>";
    $this->output .= $this->html->latest_posts($post_data,$show);
    } else {
    $query = $DB->query("SELECT t.last_poster_name, t.last_poster_id, t.title, t.tid, t.forum_id, t.last_post, f.name ".
    "FROM ibf_topics AS t LEFT JOIN ibf_forums AS f ON f.id=t.forum_id ".
    "WHERE " . $dbquery .
    " ORDER BY last_post DESC LIMIT 0,".$show);
    while($out = $DB->fetch_row($query))
    {
    $post_data .= "<tr bgcolor=#E4EAF2>"
    . "<td align=left>"
    . "<a href='{$ibforums->base_url}showtopic=$out[tid]&view=getlastpost'>$out[title]</a></td>"
    . "<td align=left>"
    . "<a href='{$ibforums->base_url}showforum=$out[forum_id]'>$out[name]</a></font></td>"
    . "<td align=left>"
    . "<a href='{$ibforums->base_url}act=Profile&CODE=03&MID=$out[last_poster_id]'>$out[last_poster_name]</a></td>"
    . "</tr>";
    }
    $this->output .= $this->html->latest_posts($post_data,$show);
    }
    //---------------------------------------
    // End Latest Posts
    //---------------------------------------

    //*****************************//
    // open skin/s1/skin_ucp.php //
    //*****************************//
    ////////
    //Find//
    ////////
    <?php
    class skin_ucp {
    /////////////
    //Below Put//
    /////////////
    function start_latest($select) {
    global $ibforums;
    return <<<EOF
    <table class=tablebasic>
    <tr>
    <td class=titlemedium>Latest Posts Setup</td>
    <td class=titlemedium>Amount to show:
    <form action="{$ibforums->base_url}act=UserCP&amp;CODE=92" method="post" name="setamount">
    <select name=show>
    $select
    </select>
    &nbsp<input type=submit value="Update Amount">
    </form></td>
    </tr>
    <form action="{$ibforums->base_url}act=UserCP&amp;CODE=91" method="post" name="setforums">
    EOF;
    }
    function cat_row($name) {
    global $ibforums;
    return <<<EOF
    <tr>
    <td class=maintitle colspan=2>$name</td>
    </tr>
    EOF;
    }
    function latest_post_row($forum, $id , $desc, $checked) {
    global $ibforums;
    return <<<EOF
    <tr>
    <td class=row3 width=30%><input type="checkbox" name="forums[]" value="$id" $checked>$forum</td>
    <td class=row2 width=70%>$desc</td>
    </tr>
    EOF;
    }
    function end_latest() {
    global $ibforums;
    return <<<EOF
    </table>
    <center><input type=submit value="Set Forums"></center>
    </form>
    EOF;
    }
    ////////
    //Find//
    ////////
    &middot; <a href='{$base_url}act=UserCP&amp;CODE=28'>{$ibforum s->lang['m_passy_opt']}</a><br />
    </p>
    /////////////
    //Below Put//
    /////////////
    <div class='pformstrip'>Latest Posts</div>
    <p>
    &middot; <a href='{$base_url}act=UserCP&amp;CODE=90'>Latest Posts</a><br />
    </p>
    //*****************************//
    // open skin/s1/skin_boards.php//
    //*****************************//
    ////////
    //Find//
    ////////
    <?php
    class skin_boards {
    /////////////
    //Below Put//
    /////////////
    function latest_posts($Data,$show) {
    global $ibforums;
    return <<<EOF
    <table cellpadding='1' cellspacing='1' width='75%' class=plainborder align=center>
    <tr>
    <td class=maintitle colspan=3>$show latest posts
    <tr>
    <td class='titlemedium' align=left>Thread</td>
    <td class='titlemedium' align=left>In Forum</td>
    <td class='titlemedium' align=left>By</td>
    </tr>
    $Data
    </table>
    <br />
    EOF;
    }
    ///////////////
    //All Done !!//
    ///////////////
    pls help me soon i have to add this script to my ipb forums and i dont know how to add database and add a usename to database

  2. #2
    03moscropl's Avatar
    03moscropl is offline Flash Freak 03moscropl is an unknown quantity at this point
    Join Date
    Jun 2005
    Location
    England
    Posts
    349

    Re: add latest forums mod to ipb

    what do you want i dont get you!
    my customised games module for phpnuke
    http://dragongamer.net/modules.php?name=arcade

  3. #3
    rahul2006 is offline x10 Sophmore rahul2006 is an unknown quantity at this point
    Join Date
    Oct 2005
    Location
    IN THE HELL , WANT TO JOIN THEN PM ME
    Posts
    214

    Re: add latest forums mod to ipb

    i want o add database in my sql which is described in this code

  4. #4
    n4tec's Avatar
    n4tec is offline Lord Of The Keys n4tec is an unknown quantity at this point
    Join Date
    Feb 2005
    Location
    GeT NOTICED via n4tec
    Posts
    1,656

    Re: add latest forums mod to ipb

    go to SQL Toolbox which located SQL Management found in the ACP..

    then paste the code below in Run a Query and then Run Query
    Code:
    ALTER TABLE `ibf_members` ADD `latest_posts` LONGTEXT NOT NULL AFTER `auto_track` ;
    ALTER TABLE `ibf_members` ADD `latest_post_show` MEDIUMINT( 2 ) DEFAULT '8' NOT NULL AFTER `latest_posts` ;
    Last edited by n4tec; 10-18-2005 at 10:12 AM.
    .::: Regards, n4tec :::.


  5. #5
    rahul2006 is offline x10 Sophmore rahul2006 is an unknown quantity at this point
    Join Date
    Oct 2005
    Location
    IN THE HELL , WANT TO JOIN THEN PM ME
    Posts
    214

    Re: add latest forums mod to ipb

    hey thanks for the help but it is showing an error to me that is this read it
    You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '; ALTER TABLE `ibf_members` ADD `latest_post_show` MEDIUMINT(
    and pls help me

  6. #6
    n4tec's Avatar
    n4tec is offline Lord Of The Keys n4tec is an unknown quantity at this point
    Join Date
    Feb 2005
    Location
    GeT NOTICED via n4tec
    Posts
    1,656

    Re: add latest forums mod to ipb

    Quote Originally Posted by rahul2006
    hey thanks for the help but it is showing an error to me that is this read it
    and pls help me
    try the code below using the previous method..

    Code:
    ALTER TABLE `ibf_members` ADD `latest_post_show` MEDIUMINT( 2 ) DEFAULT '8' NOT NULL AFTER `latest_posts` ;
    perform the instructions below if you fail to alter the ibf_members table..

    If it fails, login to your cpanel

    then go to mysql databases

    then go to phpmyadmin

    then go to the forum databases

    then look for an SQL which is btn structure and Search

    Now paste the code..

    PS. i think the error is bcoz you cannot perform multiple task via the SQL ToolBox..
    .::: Regards, n4tec :::.


  7. #7
    rahul2006 is offline x10 Sophmore rahul2006 is an unknown quantity at this point
    Join Date
    Oct 2005
    Location
    IN THE HELL , WANT TO JOIN THEN PM ME
    Posts
    214

    Re: add latest forums mod to ipb

    is there any simple method

  8. #8
    n4tec's Avatar
    n4tec is offline Lord Of The Keys n4tec is an unknown quantity at this point
    Join Date
    Feb 2005
    Location
    GeT NOTICED via n4tec
    Posts
    1,656

    Talking Re: add latest forums mod to ipb

    Quote Originally Posted by rahul2006
    is there any simple method
    go to SQL Toolbox which located SQL Management found in the ACP..

    then paste the code below in Run a Query and then Run Query

    1.
    Code:
    ALTER TABLE `ibf_members` ADD `latest_posts` LONGTEXT NOT NULL AFTER `auto_track` ;
    2.
    Code:
    ALTER TABLE `ibf_members` ADD `latest_post_show` MEDIUMINT( 2 ) DEFAULT '8' NOT NULL AFTER `latest_posts` ;
    Paste the above codes separately. If Code one is added then go to code 2..

    what is the link to your forum?
    .::: Regards, n4tec :::.


  9. #9
    rahul2006 is offline x10 Sophmore rahul2006 is an unknown quantity at this point
    Join Date
    Oct 2005
    Location
    IN THE HELL , WANT TO JOIN THEN PM ME
    Posts
    214

  10. #10
    rahul2006 is offline x10 Sophmore rahul2006 is an unknown quantity at this point
    Join Date
    Oct 2005
    Location
    IN THE HELL , WANT TO JOIN THEN PM ME
    Posts
    214

    Re: add latest forums mod to ipb

    ok tell me how to add that code in my php admin

+ Reply to Thread
Page 1 of 4 123 ... LastLast

Similar Threads

  1. useful hook for x10hosting forums
    By 3aKaT in forum Feedback and Suggestions
    Replies: 9
    Last Post: 09-18-2006, 06:39 AM
  2. [REQ] Partner of gaming/tech forums
    By James in forum The Marketplace
    Replies: 2
    Last Post: 06-04-2006, 05:09 PM
  3. Putting up ads in forums help
    By BretFan1 in forum Free Hosting
    Replies: 16
    Last Post: 04-19-2006, 06:15 AM
  4. Help putting up ads in my forums
    By BretFan1 in forum Scripts & 3rd Party Apps
    Replies: 2
    Last Post: 03-28-2006, 04:55 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers