1
Liawlius
Re: News Topic Block
  • 2005/5/3 14:35

  • Liawlius

  • Just popping in

  • Posts: 4

  • Since: 2005/4/29


I have some problems with news topics block too. I need to remove the selectbox and insted of it there must be a list of topics. Could someone plese give me any directions how I could get what I need?
Edit: I use altern8news if it matters.



2
Liawlius
Multilanguage Website
  • 2005/5/1 20:33

  • Liawlius

  • Just popping in

  • Posts: 4

  • Since: 2005/4/29


I need to make a website, in lithuanian/english languages. It's needed, that uses would me able to change language enen without registering.
1st problem is that i don't have ant idea how to make a button for changing language. 2nd problem is blocks' an modules' names. How cam I make them different when different language is chosen?
P.S. I'm sorry for my bad english.



3
Liawlius
Re: Multiple ?
  • 2005/4/29 18:49

  • Liawlius

  • Just popping in

  • Posts: 4

  • Since: 2005/4/29


My solution:

function xoops_getbanner()
{
    global 
$xoopsConfig;
    
$db =& Database::getInstance();
    
$bresult $db->query("SELECT COUNT(*) FROM ".$db->prefix("banner"));
    list (
$numrows) = $db->fetchRow($bresult);
    while (
$numrows <> 0) {
    
$numrows $numrows 1;
    
$bannum $numrows;
        
$bresult $db->query("SELECT * FROM ".$db->prefix("banner"), 1$bannum);
        list (
$bid$cid$imptotal$impmade$clicks$imageurl$clickurl$date$htmlbanner$htmlcode) = $db->fetchRow($bresult);
        if (
$xoopsConfig['my_ip'] == xoops_getenv('REMOTE_ADDR')) {
            
// EMPTY
        
} else {
            
$db->queryF(sprintf("UPDATE %s SET impmade = impmade+1 WHERE bid = %u"$db->prefix("banner"), $bid));
        }
        
/* Check if this impression is the last one and print the banner */
        
if ( $imptotal == $impmade ) {
            
$newid $db->genId($db->prefix("bannerfinish")."_bid_seq");
            
$sql sprintf("INSERT INTO %s (bid, cid, impressions, clicks, datestart, dateend) VALUES (%u, %u, %u, %u, %u, %u)"$db->prefix("bannerfinish"), $newid$cid$impmade$clicks$datetime());
            
$db->queryF($sql);
            
$db->queryF(sprintf("DELETE FROM %s WHERE bid = %u"$db->prefix("banner"), $bid));
        }
        if (
$htmlbanner){
            
$bannerobject $htmlcode;
        } else{
            
$bannerobject '<div><a href="'.XOOPS_URL.'/banners.php?op=click&bid='.$bid.'" target="_blank">';
            if (
stristr($imageurl'.swf')) {
                
$bannerobject $bannerobject
                    
.'<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" width="468" height="60">'
                    
.'<param name=movie value="'.$imageurl.'">'
                    
.'<param name=quality value=high>'
                    
.'<embed src="'.$imageurl.'" quality=high pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"; type="application/x-shockwave-flash" width="468" height="60">'
                    
.'</embed>'
                    
.'</object>';
            } else {
                
$bannerobject $bannerobject.'<img src="'.$imageurl.'" alt="" />';
            }

            
$bannerobject $bannerobject.'</a></div>';
        }
     
$banner_ret $banner_ret.'<br>'.$bannerobject;
    
}
        return 
$banner_ret;

}


Its loop whitch repeats banner adding routine untill no more banner left to add.

----
I edited this post and the previous one to use the [ code ] tag - Dave_L



4
Liawlius
Solution
  • 2005/4/29 18:48

  • Liawlius

  • Just popping in

  • Posts: 4

  • Since: 2005/4/29


I solved this problem like this:

function xoops_getbanner()
{
    global 
$xoopsConfig;
    
$db =& Database::getInstance();
    
$bresult $db->query("SELECT COUNT(*) FROM ".$db->prefix("banner"));
    list (
$numrows) = $db->fetchRow($bresult);
    while (
$numrows <> 0) {
    
$numrows $numrows 1;
    
$bannum $numrows;
        
$bresult $db->query("SELECT * FROM ".$db->prefix("banner"), 1$bannum);
        list (
$bid$cid$imptotal$impmade$clicks$imageurl$clickurl$date$htmlbanner$htmlcode) = $db->fetchRow($bresult);
        if (
$xoopsConfig['my_ip'] == xoops_getenv('REMOTE_ADDR')) {
            
// EMPTY
        
} else {
            
$db->queryF(sprintf("UPDATE %s SET impmade = impmade+1 WHERE bid = %u"$db->prefix("banner"), $bid));
        }
        
/* Check if this impression is the last one and print the banner */
        
if ( $imptotal == $impmade ) {
            
$newid $db->genId($db->prefix("bannerfinish")."_bid_seq");
            
$sql sprintf("INSERT INTO %s (bid, cid, impressions, clicks, datestart, dateend) VALUES (%u, %u, %u, %u, %u, %u)"$db->prefix("bannerfinish"), $newid$cid$impmade$clicks$datetime());
            
$db->queryF($sql);
            
$db->queryF(sprintf("DELETE FROM %s WHERE bid = %u"$db->prefix("banner"), $bid));
        }
        if (
$htmlbanner){
            
$bannerobject $htmlcode;
        } else{
            
$bannerobject '<div><a href="'.XOOPS_URL.'/banners.php?op=click&bid='.$bid.'" target="_blank">';
            if (
stristr($imageurl'.swf')) {
                
$bannerobject $bannerobject
                    
.'<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" width="468" height="60">'
                    
.'<param name=movie value="'.$imageurl.'">'
                    
.'<param name=quality value=high>'
                    
.'<embed src="'.$imageurl.'" quality=high pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"; type="application/x-shockwave-flash" width="468" height="60">'
                    
.'</embed>'
                    
.'</object>';
            } else {
                
$bannerobject $bannerobject.'<img src="'.$imageurl.'" alt="" />';
            }

            
$bannerobject $bannerobject.'</a></div>';
        }
     
$banner_ret $banner_ret.'<br>'.$bannerobject;
    
}
        return 
$banner_ret;

}


Now this function repeats banner adding routine until no more banners left. If you can suggest better solution dont be shy




TopTop



Login

Who's Online

267 user(s) are online (181 user(s) are browsing Support Forums)


Members: 0


Guests: 267


more...

Donat-O-Meter

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

Latest GitHub Commits