1
astuni
Re: GMAIL! Who wants 1?
  • 2005/3/7 10:08

  • astuni

  • Just popping in

  • Posts: 22

  • Since: 2004/6/7 4


I got 50 invites too, so anyone...just pm me your email :)



2
astuni
Re: [help]Modifiyng the xf-section top article query
  • 2005/3/2 0:37

  • astuni

  • Just popping in

  • Posts: 22

  • Since: 2004/6/7 4


Ok, done by myself, i wanna share the result because it might be useful.

Found on php.net this function:

/**
 * Examples
 *    return seconds in a year:
 *      echo time_to_seconds (0, 0, 0, 1);
 *
 *    get a time() value from 30 days ago:
 *      echo time() - time_to_seconds (0, 0, 30);
 */

function time_to_seconds ($minutes$hours=NULL$days=NULL$years=NULL) {
   
$seconds 0;

   
$seconds += $minutes 60;
   if (
$hours != NULL$seconds += $hours 3600;
   if (
$days  != NULL$seconds += $days  86400;
   if (
$years != NULL$seconds += $years 31536000;
  
   return 
$seconds;
}


so i applyed it to the /modules/xfsection/blocks/xfs_top.php
making it looks this way:
if ( !function_exists('xfs_checkAccess') )
{
    include_once 
XOOPS_ROOT_PATH."/modules/xfsection/include/xfs_groupaccess.php";
}

function 
time_to_seconds ($minutes$hours=NULL$days=NULL$years=NULL) {
   
$seconds 0;

   
$seconds += $minutes 60;
   if (
$hours != NULL$seconds += $hours 3600;
   if (
$days  != NULL$seconds += $days  86400;
   if (
$years != NULL$seconds += $years 31536000;
  
   return 
$seconds;
}

function 
b_xfs_top_show($options) {    // *** change this ***
    
global $xoopsDB;
    
$myts =& MyTextSanitizer::getInstance();
    
$block = array();

// *** change this ***
//    $sql = "SELECT articleid, title, published, expired, counter, groupid FROM ".$xoopsDB->prefix("wfs_article")." WHERE published < ".time()." AND published > 0 AND (expired = 0 OR expired > ".time().") AND noshowart = 0 AND offline = 0 ORDER BY ".$options[0]." DESC";
    
$sql "SELECT articleid, title, published, expired, counter, groupid FROM ".$xoopsDB->prefix("xfs_article")." WHERE published < ".time()." AND published > ".(time() - time_to_seconds (0030))." AND (expired = 0 OR expired > ".time().") AND noshowart = 0 AND offline = 0 ORDER BY ".$options[0]." DESC";

    
$result $xoopsDB->query($sql,$options[1],0);
    while ( 
$myrow $xoopsDB->fetchArray($result) ) {

// for avoiding to collide with WFsection.
//    if(checkAccess($myrow["groupid"])) {    
    
if(xfs_checkAccess($myrow["groupid"])) {

        
$wfs = 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)))."...";
            }
        }
        
$wfs['title'] = $title;
        
$wfs['id'] = $myrow['articleid'];
        if ( 
$options[0] == "published" ) {
            
$wfs['top'] = formatTimestamp($myrow['published'],"s");
        } elseif ( 
$options[0] == "counter" ) {
            
$wfs['top'] = $myrow['counter'];
        }
        
$block['top'][] = $wfs;
    }
    }
    return 
$block;
}

function 
b_xfs_top_edit($options) {    // *** change this ***

// rename WFS to XFS
    
$form ""._MB_XFS_ORDER."&nbsp;<select name='options[]'>";

    
$form .= "<option value='published'";
    if ( 
$options[0] == "published" ) {
        
$form .= " selected='selected'";
    }

// rename WFS to XFS
    
$form .= ">"._MB_XFS_DATE."</option>n";

    
$form .= "<option value='counter'";
    if(
$options[0] == "counter"){
        
$form .= " selected='selected'";
    }

// rename WFS to XFS
    
$form .= ">"._MB_XFS_HITS."</option>n";

    
$form .= "</select>n";

// rename WFS to XFS
    
$form .= "&nbsp;"._MB_XFS_DISP."&nbsp;<input type='text' name='options[]' value='".$options[1]."' />&nbsp;"._MB_XFS_ARTCLS."";
    
$form .= "&nbsp;<br>"._MB_XFS_CHARS."&nbsp;<input type='text' name='options[]' value='".$options[2]."' />&nbsp;"._MB_XFS_LENGTH."";


    return 
$form;
}
?>

After including the function the key is:
AND published ".(time() - time_to_seconds (0, 0, 30))."

so the result is that he pulls off db the top articles of the last 30 days.
Cheers



3
astuni
[help]Modifiyng the xf-section top article query
  • 2005/3/1 1:54

  • astuni

  • Just popping in

  • Posts: 22

  • Since: 2004/6/7 4


$sql "SELECT articleid, title, published, expired, counter, groupid FROM ".$xoopsDB->prefix("xfs_article")." WHERE published < ".time()." AND published > 0 AND (expired = 0 OR expired > ".time().") AND noshowart = 0 AND offline = 0 ORDER BY ".$options[0]." DESC";


This is the query for the top articles block of xf-section, there is any way to modify it to show only the "last month" top articles?

I believe there is something to tweak on "AND published > 0" using some time() feature but i dont know how, anyone can help?

Thanks!



4
astuni
Re: Customizing "SIte Off" page
  • 2005/2/8 22:28

  • astuni

  • Just popping in

  • Posts: 22

  • Since: 2004/6/7 4


you need to edit the template system_siteclosed by cloning the default template set first (if you havent already done that) and edit the template after.

Alternatively you can edit directly the system_siteclosed.html file located in xoops_root_path/modules/system/templates dir but this will edit the default template set and imho is more clean to work with a clone.

Remember to flush templates_c dir to see the changes of your edits.
See ya.



5
astuni
Re:help with koivi
  • 2004/11/9 12:08

  • astuni

  • Just popping in

  • Posts: 22

  • Since: 2004/6/7 4


Quote:

WarDick wrote:
Hi Samuels,

First let me say thank you for such a great implementation. I have just installed it into my news module and all works well except for the problem described above. I can not insert an image though the image manager. I followed your advice.

Quote:
For imagemanager you must change the imagemanager template with the one I've included on the package.

The second problem is because I had an error overriding a method.It will be fixed on new version.


Buf I still can not insert an image. It works great with the insert image button.

I guess the next item is a request rather than a bug report. To make the preview work with the theme style sheet. Such as image padding, margins and etc.


be sure to update the system module after replacing the template


@Samuels: Thanx so much!



6
astuni
Re:help with koivi
  • 2004/11/8 22:55

  • astuni

  • Just popping in

  • Posts: 22

  • Since: 2004/6/7 4


ok everything works.
Except for the image manager. i select an image and i push one of the three alignment buttons but nothing happens it just closes and it wont show any image...

also, i noticed that the title of the box now is not showing. i noticed this also in news 1.21, so i dont see anymore The Scoop, The News and Category Header strings on the left of the editor... there is any solution?



7
astuni
Re:help with koivi
  • 2004/11/8 13:26

  • astuni

  • Just popping in

  • Posts: 22

  • Since: 2004/6/7 4


@ samuels

Great!
This is wonderful, i don't know how to thank you.
Testing it now



8
astuni
Re:help with koivi
  • 2004/11/6 13:56

  • astuni

  • Just popping in

  • Posts: 22

  • Since: 2004/6/7 4


Ok, thanks.
Here's what i've done to /modules/xfsection/include/storyform.inc.php to use koivi:
after line 34 i added
//KOIVI WYSIWYG CLASS

include XOOPS_ROOT_PATH "/class/wysiwyg/formwysiwygtextarea.php";

then i replaced line 51 with
//Koivi Add
//$sform->addElement(new XoopsFormDhtmlTextArea(_WFS_MAINTEXT, 'message', $message, 15, 60), true);
$sform->addElement(new XoopsFormWysiwygTextArea_WFS_MAINTEXT'message'$message'100%''400px',''), true);

This whas the old one using spaw:
ob_start();
        
$sw = new SPAW_Wysiwyg'message'$message'en''full''default''99%''600px' );
        
$sw -> show();
        
$sform -> addElement( new XoopsFormLabel_WFS_MAINTEXTob_get_contents() ) );
        
ob_end_clean();



Notice that for spaw it uses the ob_start ob_end_clean method.

I need to include koivi in those two files also, and i wasn't able to do it cos the code is slightly different here...
the files are:
/modules/xfsection/class/wfsarticle.php
and
/public_html/modules/xfsection/admin/category.php

For wfsarticle.php i've done those mods to include spaw:
Line 58
after:
include_once XOOPS_ROOT_PATH.'/class/xoopscomments.php';

i added:
$spaw_root XOOPS_ROOT_PATH '/modules/spaw/';
include_once 
$spaw_root 'spaw_control.class.php';


Line 1190-1193
Replace
if (!strstr($HTTP_SERVER_VARS["HTTP_USER_AGENT"], "MSIE")) $wfsConfig['wysiwygeditor'] = '0';

        if (
$wfsConfig['wysiwygeditor'] == '1') {  
        
html_editor('maintext');

with:
// checks browser compatibility with the control
  
function checkBrowser() {
    global 
$HTTP_SERVER_VARS;
    
$browser $HTTP_SERVER_VARS['HTTP_USER_AGENT'];
    
// check if msie
    
if (eregi("MSIE[^;]*",$browser,$msie)) {
      
// get version 
      
if (eregi("[0-9]+.[0-9]+",$msie[0],$version)) {
        
// check version
        
if ((float)$version[0]>=5.5) {
          
// finally check if it's not opera impersonating ie
          
if (!eregi("opera",$browser)) {
            return 
true;
          }
        }
      }
    }
    return 
false;
  }
        if (
checkBrowser()) 
    {
        
$wfsConfig['wysiwygeditor'] = '1';
                        } 
    else
    {
            
$wfsConfig['wysiwygeditor'] = '0';
    }

        if (
$wfsConfig['wysiwygeditor'] == '1') {  
        
//html_editor('maintext');
        
$sw = new SPAW_Wysiwyg'maintext'$this->maintext'en''full''default''98%''550px' );
           
$sw -> show();


Then for category.php
After line 19 i added:
$spaw_root XOOPS_ROOT_PATH '/modules/spaw/';
include_once 
$spaw_root 'spaw_control.class.php';

then i replaced lines 92 with
// checks browser compatibility with the control
  
function checkBrowser() {
    global 
$HTTP_SERVER_VARS;
    
$browser $HTTP_SERVER_VARS['HTTP_USER_AGENT'];
    
// check if msie
    
if (eregi("MSIE[^;]*",$browser,$msie)) {
      
// get version 
      
if (eregi("[0-9]+.[0-9]+",$msie[0],$version)) {
        
// check version
        
if ((float)$version[0]>=5.5) {
          
// finally check if it's not opera impersonating ie
          
if (!eregi("opera",$browser)) {
            return 
true;
          }
        }
      }
    }
    return 
false;
  }
  
  if (
checkBrowser()) {
// use spaw
        
ob_start();
        
$sw = new SPAW_Wysiwyg'catdescription'$xt->catdescription("E"), 'en''full''default''99%''600px' );
        
$sw -> show();
        
$sform -> addElement( new XoopsFormLabel_WFS_CATEGORYHEADob_get_contents() ) );
        
ob_end_clean();
} else {
// do anything else
$sform->addElement(new XoopsFormDhtmlTextArea(_WFS_CATEGORYHEAD'catdescription'$xt->catdescription("E"), 1060), false);

}


so basically im done with storyform.inc.php because was easy (similar code to news module)
but i dont know how to integrate them in the other two files.
Remember that this is xf-section 1.06
dont know if 1.07 files are different, by the way if you make it for 1.07 i will update it



9
astuni
Re:help with koivi
  • 2004/11/3 22:46

  • astuni

  • Just popping in

  • Posts: 22

  • Since: 2004/6/7 4


1.06, upgrading to 1.07 if i get koivi to work with it in both category header and article editing.
Please help me



10
astuni
help with koivi
  • 2004/10/24 22:30

  • astuni

  • Just popping in

  • Posts: 22

  • Since: 2004/6/7 4


Hello.
I succesfully integrated koivi editor in news module 1.21 as docs says.

Now i wanted to do a step ahead and integrate also in xfsection.

i currently use spaw as editor in xfsection.

here's how i integrated spaw.
/modules/xfsection/class/wfsarticle.php
//html_editor('maintext');
        
$sw = new SPAW_Wysiwyg'maintext'$this->maintext'en''full''default''98%''550px' );
           
$sw -> show();

So i commented out the first line that was present in original file and i added the code lines for spaw.

Now, in koivi docs it use a different method to create the editor instance, so applying those lines into this file wont work.
Anyone can help me out integrating this?




TopTop
(1) 2 3 »



Login

Who's Online

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


Members: 0


Guests: 174


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