11
astuni
Re: Spaw and Xoops $myts. Please help.
  • 2004/9/28 4:35

  • astuni

  • Just popping in

  • Posts: 22

  • Since: 2004/6/7 4


No one can help me?



12
astuni
Spaw and Xoops $myts. Please help.
  • 2004/9/27 14:51

  • astuni

  • Just popping in

  • Posts: 22

  • Since: 2004/6/7 4


Hello, im posting here because i've already tried many times @ wf-sections site but no one can solve my problem (seems that everyone there is fulltime bug-fixing wf-sections...).

I use spaw on many text areas of my site, but i have a problem regarding the Category Header area of xf-section module.

I integrated the editor in this way:

/modules/xfsection/admin/category.php
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);


note that i included the function to check if browser is supported, if not it loads normal catdescription textarea.

Now, to the problem. I can succesfully create catdescription this way, but the error comes when i try to edit a category already done. It displays html in design area, so i wondered that $myts isnt configured properly to recognize html. Screen:
Resized Image

Now i edited the /modules/xfsection/class/wfscategory.php and i noticed the following code.

case "E":
                
$catdescription $myts->makeTareaData4Edit($this->catdescription);
                break;


I think that i have to modify something there to make it work. But i dont know what.
Any help?
Thanks.



13
astuni
Re: Strange problem
  • 2004/9/14 21:58

  • astuni

  • Just popping in

  • Posts: 22

  • Since: 2004/6/7 4


Ok, so the possible solution is to insert those links into a custom block and give the block view only to that group...i didn't thought this before

Thanks anyway!



14
astuni
Re: Strange problem
  • 2004/9/14 9:55

  • astuni

  • Just popping in

  • Posts: 22

  • Since: 2004/6/7 4


Any help?



15
astuni
Re: Strange problem
  • 2004/9/14 4:15

  • astuni

  • Just popping in

  • Posts: 22

  • Since: 2004/6/7 4


ok i checked and it was already set...
it displays it only if i give to that group the admin of at least 1 feature of system module...

[edit] I mean, user menu is ALWAYS displayed, the thing i cant see are the links i manually added to the template...

[offtopic]Whoa!!! when your XOOPS themes will be available?!?! they will be free?!?[/offtopic]

Cheers



16
astuni
Strange problem
  • 2004/9/13 22:05

  • astuni

  • Just popping in

  • Posts: 22

  • Since: 2004/6/7 4


Hello, can't find anything related in forum so i try to explain what my problem is.

I got a XOOPS site running, and i have created a group for article publishers which i gave admin rights on some modules like news, xf section, downloads and other non system modules.

Recently i upgraded the site layout moving the home page from "news" to nothing and inserting a spotlight block with recent news in home instead of complete news module...

When i created the group mentioned above i slightly edited the system_block_user.html template to show in user menu links on various administrative functions of the modules the group administer.
For instance i added something like that:
<{if $xoops_isadmin}>
    <
div class="blockTitle">Amministrazione</div>
    <
a href="<{$xoops_url}>/admin.php"><{$block.lang_adminmenu}></a>
    <
div class="blockTitle">News</div>
    <
a href="<{$xoops_url}>/modules/news/submit.php">Inserimento News</a>
    <
div class="blockTitle">Aree</div>
    <
a href="<{$xoops_url}>/modules/xfsection/admin/category.php?op=default">Gestione Sezioni</a>    
    <
a href="<{$xoops_url}>/modules/xfsection/admin/allarticles.php">Gestione Articoli</a>
    <
a href="<{$xoops_url}>/modules/xfsection/admin/index.php?op=default">Inserimento Articoli</a>
    <
div class="blockTitle">Links</div>
    <
a href="<{$xoops_url}>/modules/mylinks/admin/index.php?op=linksConfigMenu">Inserimento Links</a>
    <
div class="blockTitle">Sondaggi</div>
    <
a href="<{$xoops_url}>/modules/xoopspoll/admin/index.php?op=add">Inserimento Sondaggi</a>
      <{/if}>



Since i had news as home page modules that links on user menu showed correctly. Now that home page is "nothing" those links are gone, the strange thing is that if i navigate on news module they show up again.

I noticed that to make them show i must give to that group admin rights for at least 1 system feature, which is something i dont really wanna do.

Is there a way to fix this to make my old admin user menu links to show up even if no module are set as home page?

I hope that it's clear enough...
Cheers
Astuni



17
astuni
Re: Help with Spaw plz.
  • 2004/6/21 8:23

  • astuni

  • Just popping in

  • Posts: 22

  • Since: 2004/6/7 4


Also i would like to have a better bug free version of wfsections 2.01 cos this one gives me a lot of troubles regarding blank pages on category creation and many others that have been already reported, i will wait for a real stable bug free version before switch.

Thank you anyway and keep up the good work, and sorry for double post
Cya
Astuni



18
astuni
Re: Help with Spaw plz.
  • 2004/6/21 8:20

  • astuni

  • Just popping in

  • Posts: 22

  • Since: 2004/6/7 4


Thank you chapi, it worked well, cool the feature that checks for IE Version and if its not opera acting like it...

@wfsection: maybe you could insert that function in wfsection 2.01 and Wfchannel 1.6 cos now it seems to check only if its MSIE and not its version, also, acting that way, every opera browser set to identify as IE will get the wysiwyg...not working...

This is wfchannel/admin/index.php code around line 133
if (!$xoopsModuleConfig['usespaw'] || !strstr($_SERVER["HTTP_USER_AGENT"], "MSIE"))
    {
        
$sform->addElement(new XoopsFormDhtmlTextArea(_AM_CHANA _AM_WORDCOUNT $total_words'page'$page1560), false);
    } 
    else
    {
        
ob_start();
        
$sw = new SPAW_Wysiwyg('page'$page'en''full''default''99%''600px');
        
$sw->show();
        
$sform->addElement(new XoopsFormLabel(_AM_CHANA _AM_WORDCOUNT $total_words ob_get_contents(), 1));
        
ob_end_clean();
    }


i would change it using that function like this starting from line 133:
// 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 (!
$xoopsModuleConfig['usespaw'] || checkBrowser())
    {
        
ob_start();
        
$sw = new SPAW_Wysiwyg('page'$page'en''full''default''99%''600px');
        
$sw->show();
        
$sform->addElement(new XoopsFormLabel(_AM_CHANA _AM_WORDCOUNT $total_words ob_get_contents(), 1));
        
ob_end_clean();
    } 
    else
    {
        
$sform->addElement(new XoopsFormDhtmlTextArea(_AM_CHANA _AM_WORDCOUNT $total_words'page'$page1560), false);
        
    }

that was for wfchannel 1.6

Thanx to both for infos.
Cya
Astuni



19
astuni
Help with Spaw plz.
  • 2004/6/20 15:08

  • astuni

  • Just popping in

  • Posts: 22

  • Since: 2004/6/7 4


Hello, i've succesfully inserted Spaw in most textareas of my site\modules, but i need help doing something more.
I want a way to enable spaw only if user browser is MSIE otherwise it displays normal textarea field...

Since i use Xfsection, i saw that it use a trick based on an if statement...
if (!strstr($HTTP_SERVER_VARS["HTTP_USER_AGENT"], "MSIE")) $wfsConfig['wysiwygeditor'] = '0';

        if (
$wfsConfig['wysiwygeditor'] == '1') {  
        
//html_editor('maintext');
        
$sw = new SPAW_Wysiwyg'maintext'$this->maintext'en''full''default''98%''550px' );
           
$sw -> show();
        
$smiliepath $wfsConfig['smiliepath'];
        
$smilie_array XoopsLists::getimgListAsArray(XOOPS_ROOT_PATH."/".$smiliepath);

        echo 
"<br /><div style='text-align: left;'><b>" ._AM_SMILIE."</b><br />";
        echo 
"<table><tr><td align='top' valign='left'>";
        echo 
"<div><script type='text/javascript'>
        <!--
            function showbutton() {
                   document.all."
.$textareaname."_mysmile.src = '".$xoopsConfig['xoops_url']."/$smiliepath/' + document.all.".$textareaname."_smiley.value;
            }


the problem here is that if the browser is MSIE it enables wysiwyg editor in $wfsConfig, otherwise is disabled...thats the trick, now since in "NEWS" module, for instance, i dont have any "$wfsConfig" is there a way to make that code like "universal" :)?

//If admin - show admin form
//TODO: Change to "If submit privilege"
if ($approveprivilege) {
    
//Show topic image?
    
$sform->addElement(new XoopsFormRadioYN(_AM_TOPICDISPLAY'topicdisplay'$topicdisplay));
    
//Select image position
    
$posselect = new XoopsFormSelect(_AM_TOPICALIGN'topicalign'$topicalign);
    
$posselect->addOption('R'_AM_RIGHT);
    
$posselect->addOption('L'_AM_LEFT);
    
$sform->addElement($posselect);
    
//Publish in home?
    //TODO: Check that pubinhome is 0 = no and 1 = yes (currently vice versa)
    
$sform->addElement(new XoopsFormRadioYN(_AM_PUBINHOME'ihome'$ihome_NO_YES));
}

[
b]ob_start();
$sw = new SPAW_Wysiwyg'hometext'$hometext'en''full''default''99%''600px' );
$sw -> show();
$sform -> addElement( new XoopsFormLabel_NW_THESCOOPob_get_contents() ) );
ob_end_clean();
//Extra info
//If admin -> if submit privilege
if ($approveprivilege) {
   
ob_start();
$sw = new SPAW_Wysiwyg'bodytext'$bodytext'en''full''default''99%''600px' );
$sw -> show();
$sform -> addElement( new XoopsFormLabel_AM_EXTEXTob_get_contents() ) );
ob_end_clean();
}[/
b]


this is where i've put the spaw lines in modules/news/include/storyform.inc.php
and this is latest news module version...

help me getting this into an if statment with browser check php guru's

cheers Astuni
Long life to XOOPS!



20
astuni
Re: Can i edit this?...
  • 2004/6/8 4:41

  • astuni

  • Just popping in

  • Posts: 22

  • Since: 2004/6/7 4


anyone that can help me?




TopTop
« 1 (2) 3 »



Login

Who's Online

187 user(s) are online (120 user(s) are browsing Support Forums)


Members: 0


Guests: 187


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