1
file2mail
Re: CBB - img tags case sensitive?
  • 2010/5/18 13:24

  • file2mail

  • Just popping in

  • Posts: 27

  • Since: 2004/5/23


Why hasnt this ever been fixed in the xoops source?

Most other cms/blog systems will be case insensitive for bbcodes.

its a simple code update really. just change all /sU to /isU in the textsanitizer module for xoopsCodeDecode



2
file2mail
Re:How to put news on index page
  • 2004/12/10 1:22

  • file2mail

  • Just popping in

  • Posts: 27

  • Since: 2004/5/23


Hey... thanks alot for the suggestion...

... i have also noticed that i made a simple but important mistake earlier... i neglected to add 'comments' to mySQL table grab ... so that the comments thing wasnt working properly...

so here is my updated code for my modified modules/news/blocks/news_top.php:
............

function 
b_news_top_show($options) {
    global 
$xoopsDB;
    
$myts =& MyTextSanitizer::getInstance();
    
$block = array();
            
//should use 'topicid' for implementing News Topics in future
    
$sql "SELECT storyid, title, published, expired, counter, [b]hometext, bodytext, [u]nohtml, nosmiley, comments[/u][/b] FROM ".$xoopsDB->prefix("stories")." WHERE published < ".time()." AND published > 0 AND (expired = 0 OR expired > ".time().") ORDER BY ".$options[0]." DESC";
    
$result $xoopsDB->query($sql,$options[1],0);
    while ( 
$myrow $xoopsDB->fetchArray($result) ) {
        
$news = array();
        
$title $myts->makeTboxData4Show($myrow["title"]);
        if ( !
XOOPS_USE_MULTIBYTES ) {
            if (
strlen($myrow['title']) >= $options[2]) {
                
$title $myts->makeTboxData4Show(substr($myrow['title'],0,($options[2] -1)))."...";
            }
        }
        
$news['title'] = $title;
        [
b][u]$news['text'] = $myts->makeTareaData4Show$myrow['hometext'], !$myrow['nohtml'], !$myrow['nosmiley'], 1);[/u]
        if( 
$myrow['bodytext'] == "" ) {
            
$news['readmore'] = "";
        } else {
            
$news['readmore'] = "Read More... | ";
        }
        [
u]if( $myrow['comments'] == ){
            
$news['comments'] = "Post Comment";
        } else{
            
$news['comments'] = $myrow['comments']." Comment(s)";
        }[/
u]
        
$news['id'] = $myrow['storyid'];
            
$news['date'] = formatTimestamp($myrow['published'],"s");
            
$news['hits'] = $myrow['counter'];
        
$block['stories'][] = $news;
        
$block['numStory'] = $options[1];
    }[/
b]
    return 
$block;
}

.................


It includes the fix for displaying # of comments, and a better way than martyras's to show the html and smileys (where it depends on if you check the NO HTML or NO SMILEY options when creating a new story)
Not bad for someone who doesnt know php huh?

and also... i think a way we would be able to show the news topic in the title is to take the 'topicid' variable and also get data from some other MySQL table that has the topic names in it ... then with that we can show the topic names... but i know even lesser about SQL than php ... which is like less than nothing... someone else who knows more about php and MySQL please help?



3
file2mail
Re:How to put news on index page
  • 2004/10/21 10:01

  • file2mail

  • Just popping in

  • Posts: 27

  • Since: 2004/5/23


Hey guys.... so i basically figured it all out for myself...
... i basically remade the Recent News block to look almost exactly like it would if your home page was the news module...

so heres the template for news_block_new.html ... which i edited (a clone) in the Template Manager in the admin ... no need to go edit the actual file and have to update the entire module...
<{foreach item=news from=$block.stories}>
<
div class="item">
  <
div class="itemHead"><span class="itemTitle">
     <
a href="<{$xoops_url}>/modules/news/article.php?storyid=<{$news.id}>"><{$news.title}></a>
  </
span></div>
  <
div class="itemInfo">
    <
span class="itemPostDate"><{$news.date}></span> (<span class="itemStats"><{$news.hits}> reads</span>)
  </
div>
  <
div class="itemBody">
    <{
$story.imglink}>
    <
class="itemText"><{$news.text}></p>
  </
div>
  <
div class="itemFoot"><span class="itemPermaLink">
    <
a href="<{$xoops_url}>/modules/news/article.php?storyid=<{$news.id}>"><{$news.readmore}><{$news.comments}></a>
  </
span></div></div><br />
<{/foreach}>
<
hr>
<
div style="text-align: right; margin: 10px;"><b><i><a href="<{$xoops_url}>/modules/news/">[Read More News]</a></i></b></div>



...and here is my modified modules/news/blocks/news_top.php
<?php
// $Id: news_top.php,v 1.1 2004/01/29 14:45:49 buennagel Exp $
//  ------------------------------------------------------------------------ //
//                XOOPS - PHP Content Management System                      //

...................

//  ------------------------------------------------------------------------ //

function b_news_top_show($options) {
    global 
$xoopsDB;
    
$myts =& MyTextSanitizer::getInstance();
    
$block = array();
    
$sql "SELECT storyid, title, [b]hometext, bodytext,[/b] published, expired, counter FROM ".$xoopsDB->prefix("stories")." WHERE published < ".time()." AND published > 0 AND (expired = 0 OR expired > ".time().") ORDER BY ".$options[0]." DESC";
    
$result $xoopsDB->query($sql,$options[1],0);
    while ( 
$myrow $xoopsDB->fetchArray($result) ) {
        
$news = array();
        
$title $myts->makeTboxData4Show($myrow["title"]);
        if ( !
XOOPS_USE_MULTIBYTES ) {
            if (
strlen($myrow['title']) >= $options[2]) {
                
$title $myts->makeTboxData4Show(substr($myrow['title'],0,($options[2] -1)))."...";
            }
        }
        
$news['title'] = $title;
[
b]        $news['text'] = $myts->displayTarea$myrow['hometext'] );
        if( 
$myrow['bodytext'] == "" ) {
            
$news['readmore'] = "";
        } else {
            
$news['readmore'] = "Read More... | ";
        }
        if( 
$myrow['comments'] != ){
            
$news['comments'] = (string)$myrow['comments']." Comment(s)";
        } else{
            
$news['comments'] = "Post Comment";
        }
        
$news['id'] = $myrow['storyid'];
        
$news['date'] = formatTimestamp($myrow['published'],"s");
        
$news['hits'] = $myrow['counter'];

        
$block['stories'][] = $news;
[/
b]    }
    return 
$block;
}

.........................

    return 
$form;
}
?>



... so its not totally complete.. i still have to add the news topic name to prefix the title area of each news post ...
...and a good advantage to this block is that it loads MUCH faster than if i had my start page as the news module... and you can also cache the block for better performance...

...i actually dont really know anything about php ... just clawing my way along ... so any comments/critique on the code is welcomed!



4
file2mail
Re:[img] String Replacement in Mylinks
  • 2004/10/21 6:19

  • file2mail

  • Just popping in

  • Posts: 27

  • Since: 2004/5/23


The problem is with the question mark ... as a security precaution ... urls entered with a ? are not parsed in case of it used to execute some sort of code...

[img]<URL>/image.php?a=1&b=2&image=1[/img] <-- has a question mark

... if u want to disable this and allow question marks.. go into the module.textsanitiser.php file ...

and change this:
$patterns[] = "/[img align=(['"]?)(left|center|right)\1]([^"()?&'<>]*)[/img]/sU";
$patterns[] = "/[img]([^"()?&'<>]*)[/img]/sU";
$patterns[] = "/[img align=(['"]?)(left|center|right)\1 id=(['"
]?)([0-9]*)\3]([^"()?&'<>]*)[/img]/sU";
$patterns[] = "/[img id=(['"]?)([0-9]*)\1]([^"()?&'<>]*)[/img]/sU";


and remove the \? from all four of those ... so its like:
$patterns[] = "/[img align=(['"]?)(left|center|right)\1]([^"()&'<>]*)[/img]/sU";
$patterns[] = "/[img]([^"()&'<>]*)[/img]/sU";
$patterns[] = "/[img align=(['"]?)(left|center|right)\1 id=(['"
]?)([0-9]*)\3]([^"()&'<>]*)[/img]/sU";
$patterns[] = "/[img id=(['"]?)([0-9]*)\1]([^"()&'<>]*)[/img]/sU";



This has been discussed before... you should really search around more on the forum ... the answer is there with a little bit of searching



5
file2mail
Re:How to put news on index page
  • 2004/10/14 9:08

  • file2mail

  • Just popping in

  • Posts: 27

  • Since: 2004/5/23


Alright ... so does any one else know how to process the XOOPS BB codes?
i assume it has something to do with the textsanitizer?
anyone???



6
file2mail
Re: How to put news on index page
  • 2004/10/10 11:09

  • file2mail

  • Just popping in

  • Posts: 27

  • Since: 2004/5/23


gooberlx ... this works .. but the only problem for me, is that i can t get the XOOPS bb code to work ... so all my news items all have [img] this and [url=] that everywhere ..

how can i fix this?



7
file2mail
Re: Newbb Hack - updating for 2.0.7?
  • 2004/9/25 12:07

  • file2mail

  • Just popping in

  • Posts: 27

  • Since: 2004/5/23



update:
Alright so heres the thing... i just created a new group to test with ... added one test user... and that user was able to access the private forum properly...
BUT using the default 'Registered Users' Group ... the default group of which all registered members are put in ... wont work with the hack...

I would like it so that all registered users and all new users will be able to access this forum without me having to add each user by hand to a new group.

Is this the way its supposed to work? can it work the way that i've described, with the 'Registered Users' group?
Thanks for the help.



8
file2mail
Re: Newbb Hack - updating for 2.0.7?
  • 2004/9/16 20:10

  • file2mail

  • Just popping in

  • Posts: 27

  • Since: 2004/5/23


Yes i have ...
ive even redownloaded the .zip from regenr8's site and reinstalled it again ...

EDIT:
Also, just wondering... is the viewforum.php file modified at all? because in my package there was no updated viewforum.php file ... is this the way its supposed to be?

And i turned on php debug, and i get this error as a member of the permissions group after i click on the private forum:

Notice [PHP]: Use of undefined constant _XT_TE_BLOCO - assumed '_XT_TE_BLOCO' in file modules/xt_temas/blocks/xt_temas.php line 6
Notice [PHP]: Undefined variable: in_clause in file modules/newbb/functions.php line 394



9
file2mail
Re: Newbb Hack - updating for 2.0.7?
  • 2004/9/15 8:42

  • file2mail

  • Just popping in

  • Posts: 27

  • Since: 2004/5/23


the blocks i am not really concerned about...
althogh all of the caching for the forum blocks are off



10
file2mail
Re: Newbb Hack - updating for 2.0.7?
  • 2004/9/14 9:39

  • file2mail

  • Just popping in

  • Posts: 27

  • Since: 2004/5/23


Well all caching has been turned off... its still not working properly...




TopTop
(1) 2 3 »



Login

Who's Online

230 user(s) are online (125 user(s) are browsing Support Forums)


Members: 0


Guests: 230


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