Subject:*
<
Name/Email:*
<
Message Icon:*
<
Select*
<
Message:*
<



Click the Preview to see the content in action.
Options:*
<
Confirmation Code*
<
2 - 0 = ?  
Input the result from the expression
Maximum attempts you can try: 10
*
<
     

Re: Help with Spaw plz.
by astuni on 2004/6/21 8:23:44

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
Re: Help with Spaw plz.
by astuni on 2004/6/21 8:20:18

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
le="color: #000000"><?php if (!$xoopsModuleConfig['usespaw'] || !strstr($_SERVER["HTTP_USER_AGENT"], "MSIE")) { $sform->addElement(new XoopsFormDhtmlTextArea(_AM_CHANA . _AM_WORDCOUNT . $total_words, 'page', $page, 15, 60), 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:
le="color: #000000"><?php // 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', $page, 15, 60), false); }

that was for wfchannel 1.6

Thanx to both for infos.
Cya
Astuni
Re: Help with Spaw plz.
by chapi on 2004/6/20 16:44:22

This function checks, if the user has MSIE 5.5 or higher.

le="color: #000000"><?php // 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; }


Include this in your script and call it like the following:

le="color: #000000"><?php if (checkBrowser()) { // use spaw } else { // do anything else }
Re: Help with Spaw plz.
by Catzwolf on 2004/6/20 15:57:38

Are you using the spaw module? If you are I would suggest taking a look at WF-Sections v2.01 or WF-Channel v1.6 for how this has been done.



Help with Spaw plz.
by astuni on 2004/6/20 15:08:07

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...
le="color: #000000"><?php 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" :)?

le="color: #000000"><?php //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_THESCOOP, ob_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_EXTEXT, ob_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!

Who's Online

213 user(s) are online (159 user(s) are browsing Support Forums)


Members: 0


Guests: 213


more...

Donat-O-Meter

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

Latest GitHub Commits