21
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



22
oilkp
Re: loading time
  • 2010/7/1 10:27

  • oilkp

  • Just popping in

  • Posts: 23

  • Since: 2010/6/30





23
oilkp
Publisher and xlanguage problem
  • 2010/6/30 14:37

  • oilkp

  • Just popping in

  • Posts: 23

  • Since: 2010/6/30


Hi there,

Need some help on solving problem with xlanguage and publisher

My layout is screwed in publisher index/category page - The last item table is not showing correctly

in the item article page it is displayed correctly it is just in the index/category page im having this problem

eg: some screenshots

http://www.glowfoto.com/static_image/30-073340L/4306/jpg/06/2010/img5/glowfoto

http://www.glowfoto.com/static_image/30-093539L/4938/jpg/06/2010/img4/glowfoto
Help...

Thank you in advance


p/s Publisher alpha & xl 3.02




TopTop
« 1 2 (3)



Login

Who's Online

200 user(s) are online (124 user(s) are browsing Support Forums)


Members: 0


Guests: 200


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