1
oilkp
XOBILE - Newbb Plugin Help
  • 2010/7/30 3:08

  • oilkp

  • Just popping in

  • Posts: 23

  • Since: 2010/6/30


First of all thanks for this module

i would like to request some help to modify the newbb plugin module of xobile

currently it shows only post without the name of author of the reply/topic etc

there are two files to edit

main.php - list of topic/reply
read.php - content of the topic/reply

what i managed to do so far is to show the user id of the post in read.php

heres the read.php code that i modified... it is currently working its shows content of post with the uid instead of username

how do i convert uid to username ?

<?php
###############################################################################
##   Copyright (C) 2009  Dylian Melgert                                      ##
##                                                                           ##
##      This program is free software: you can redistribute it and/or modify ##
##      it under the terms of the GNU General Public License as published by ##
##      the Free Software Foundation, either version 3 of the License, or    ##
##      (at your option) any later version.                                  ##
##                                                                           ##
##      This program is distributed in the hope that it will be useful,      ##
##      but WITHOUT ANY WARRANTY; without even the implied warranty of       ##
##      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        ##
##      GNU General Public License for more details.                         ##
##                                                                           ##
##      You should have received a copy of the GNU General Public License    ##
##      along with this program.  If not, see <http://www.gnu.org/licenses/>.##
###############################################################################
$replacements = array(
        
"à" => "a'",
        
"á" => "a'",
        
"è" => "e'",
        
"é" => "e'",
        
"ì" => "i'",
        
"ò" => "o'",
        
"ù" => "u'",
        
"ú" => "u'",
    
"[img align=left]" => "[IMG]",
    
"[img align=right]" => "[IMG]",
    
"[/img]" => "[IMG]",
        
"&nbsp;" => " ",
    );

$post_id intval($_GET['id']);

$sql "SELECT * FROM ".$GLOBALS['xoopsDB']->prefix("bb_posts")." WHERE post_id = $post_id";
$result $GLOBALS['xoopsDB']->queryF($sql);
$row $GLOBALS['xoopsDB']->fetchArray($result);
$subject strtr(strip_tags($row["subject"]), $replacements);
$uid strtr(strip_tags($row["uid"]), $replacements);

$sql "SELECT * FROM ".$GLOBALS['xoopsDB']->prefix("bb_posts_text")." WHERE post_id = $post_id";
$result $GLOBALS['xoopsDB']->queryF($sql);
$row $GLOBALS['xoopsDB']->fetchArray($result);
$content strtr(strip_tags($row["post_text"]), $replacements);

$xoBile_text = new HAW_text("$subject:"HAW_TEXTFORMAT_BOLD);
$xoBile_text->set_br(1);
$xoBile_page->add_text($xoBile_text);
$xoBile_page->renderXoCode($content);
$xoBile_text->set_br(1);
$xoBile_page->renderXoCode("- $uid");

$xoBile_page->backURL "index.php?mod=newbb";
?>


and heres the main.php ..where i also want to show the author username


<?php
###############################################################################
##   Copyright (C) 2009  Dylian Melgert                                      ##
##                                                                           ##
##      This program is free software: you can redistribute it and/or modify ##
##      it under the terms of the GNU General Public License as published by ##
##      the Free Software Foundation, either version 3 of the License, or    ##
##      (at your option) any later version.                                  ##
##                                                                           ##
##      This program is distributed in the hope that it will be useful,      ##
##      but WITHOUT ANY WARRANTY; without even the implied warranty of       ##
##      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        ##
##      GNU General Public License for more details.                         ##
##                                                                           ##
##      You should have received a copy of the GNU General Public License    ##
##      along with this program.  If not, see <http://www.gnu.org/licenses/>.##
###############################################################################
$replacements = array(
        
"à" => "a'",
        
"á" => "a'",
        
"è" => "e'",
        
"é" => "e'",
        
"ì" => "i'",
        
"ò" => "o'",
        
"ù" => "u'",
        
"ú" => "u'",
        
"&nbsp;" => " ",
    );

$sql "SELECT * FROM ".$GLOBALS['xoopsDB']->prefix("bb_posts")." ORDER BY post_id DESC limit 0,5";
$result $GLOBALS['xoopsDB']->queryF($sql);
$xoBile_lnks = new HAW_linkset();
while (
$row $GLOBALS['xoopsDB']->fetchArray($result)) {
    
$xoBile_link strtr(strip_tags($row["subject"]), $replacements);
    
$xoBile_link ucfirst ($xoBile_link);
    
$xoBile_link = new HAW_link($xoBile_link"index.php?mod=newbb&page=read&id=".$row['post_id']);
    
$xoBile_link->set_br(1);
    
$xoBile_lnks->add_link($xoBile_link);
}
$xoBile_page->add_linkset($xoBile_lnks);
?>


help

2
oilkp
Re: XOBILE - Newbb Plugin Help
  • 2010/7/31 13:53

  • oilkp

  • Just popping in

  • Posts: 23

  • Since: 2010/6/30


for read.php done..

<?php
###############################################################################
##   Copyright (C) 2009  Dylian Melgert                                      ##
##                                                                           ##
##      This program is free software: you can redistribute it and/or modify ##
##      it under the terms of the GNU General Public License as published by ##
##      the Free Software Foundation, either version 3 of the License, or    ##
##      (at your option) any later version.                                  ##
##                                                                           ##
##      This program is distributed in the hope that it will be useful,      ##
##      but WITHOUT ANY WARRANTY; without even the implied warranty of       ##
##      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        ##
##      GNU General Public License for more details.                         ##
##                                                                           ##
##      You should have received a copy of the GNU General Public License    ##
##      along with this program.  If not, see <http://www.gnu.org/licenses/>.##
###############################################################################
$replacements = array(
        
"à" => "a'",
        
"á" => "a'",
        
"è" => "e'",
        
"é" => "e'",
        
"ì" => "i'",
        
"ò" => "o'",
        
"ù" => "u'",
        
"ú" => "u'",
    
"[img align=left]" => "[IMG]",
    
"[img align=right]" => "[IMG]",
    
"[/img]" => "[IMG]",
        
"&nbsp;" => " ",
    );

$post_id intval($_GET['id']);

$sql "SELECT * FROM ".$GLOBALS['xoopsDB']->prefix("bb_posts")." WHERE post_id = $post_id";
$result $GLOBALS['xoopsDB']->queryF($sql);
$row $GLOBALS['xoopsDB']->fetchArray($result);
$subject strtr(strip_tags($row["subject"]), $replacements);
$uid strtr(strip_tags($row["uid"]), $replacements);


$sql "SELECT * FROM ".$GLOBALS['xoopsDB']->prefix("users")." WHERE uid = $uid";
$result $GLOBALS['xoopsDB']->queryF($sql);
$row $GLOBALS['xoopsDB']->fetchArray($result);
$username strtr(strip_tags($row["uname"]), $replacements);



$sql "SELECT * FROM ".$GLOBALS['xoopsDB']->prefix("bb_posts_text")." WHERE post_id = $post_id";
$result $GLOBALS['xoopsDB']->queryF($sql);
$row $GLOBALS['xoopsDB']->fetchArray($result);
$content strtr(strip_tags($row["post_text"]), $replacements);

$xoBile_text = new HAW_text("$subject:"HAW_TEXTFORMAT_BOLD);
$xoBile_text->set_br(1);
$xoBile_page->add_text($xoBile_text);
$xoBile_page->renderXoCode($content);
$xoBile_text->set_br(1);
$xoBile_page->renderXoCode("- by $username");

$xoBile_page->backURL "index.php?mod=newbb";
?>


still trying to figure out how to do this in main.php

Login

Who's Online

221 user(s) are online (174 user(s) are browsing Support Forums)


Members: 1


Guests: 220


tzvook,

more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Apr 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits