41
iHackCode
Re: Soundcloud BB tag support

XOOPS BBCode for SoundCloud

https://xoops.org/modules/newbb/viewtopic.php?post_id=356724#forumpost356724



42
iHackCode
Re: HTML Signature. Possible ?

XOOPS BBCode for SoundCloud. (parts were taken fromhttp://blog.soundcloud.com/2009/07/28/soundcloud-player-in-forums-5-step-guide-for-soundcloud-bb-code/)

*Download the soundcloud image for the text editor.

downloadhttp://bit.ly/tV7mm (from step 3 in the soundcloud blog) save it as soundcloud.png and upload it to yourdomain.com/images/form

*Go to your site and create a folder called soundcloud in:
yourdomain.com/class/textsanitizer

so it looks like
yourdomain.com/class/textsanitizer/soundcloud


* add two files to it

index.html
<script>history.go(-1);</script>


soundcloud.php
<?php

class MytsSoundcloud extends MyTextSanitizerExtension
{
    function 
encode($textarea_id)
    {
        
$config parent::loadConfigdirname(__FILE__) );
        
$code "<img src='{$this->image_path}/soundcloud.png' alt='SoundCloud' onclick='xoopsCodeSoundCloud("{$textarea_id}","" . htmlspecialchars('Enter SoundCloud Profile URL', ENT_QUOTES) . "");'  onmouseover='style.cursor="hand"'/>&nbsp;";
        
$javascript = <<<EOH
            function xoopsCodeSoundCloud(id, enterSoundCloud)
            {
                var selection = xoopsGetSelect(id);
                if (selection.length > 0) {
                    var text = selection;
                } else {
                    var text = prompt(enterSoundCloud, "");
                }
                
                var domobj = xoopsGetElementById(id);
                xoopsInsertText(domobj, "[soundcloud]"+text+"[/soundcloud]");
                domobj.focus();
            }
EOH;

        return array(
$code$javascript);
    }

    function 
load(&$ts)
    {
        
$ts->patterns[] = "/[soundcloud](http[s]?://[^"'<>]*)(.*)[/soundcloud]/esU";
        $ts->replacements[] = __CLASS__ . "::decode('
\1\2')";
    }

    function decode($url)
    {
        $config = parent::loadConfig(dirname(__FILE__));
        if (!preg_match("/^http://(www.)?soundcloud.com/(.*)/i", $url, $matches)) {
            trigger_error("Not matched: {$url}", E_USER_WARNING);
            return "";
        }
        
        $code = '
<object height="81" width="100%"><param name="movie" value="http://player.soundcloud.com/player.swf?url='.$url.'&g=bb">';
        $code .= '
</param><param name="allowscriptaccess" value="always"></param>';
        $code .= '
<embed allowscriptaccess="always" height="81" src="http://player.soundcloud.com/player.swf?url='.$url.'&g=bb" type="application/x-shockwave-flash" width="100%"></embed></object>';
        $code .= '
<a href="'.$url.'">'.$url.'</a>';
        
        return $code;
    }
}
?>


I also included the soundcloud.php file here ->>https://gist.github.com/ihackcode/d46633276fe128d1ffc0

*edit this file yourdomain.com/class/textsanitizer/config.php

enable the soundcloud bbcode in the extensions array by adding this line

"soundcloud" => 1,

Example of including the element in the array
"extensions" => array(
        
"iframe" => 0,
        
"image" => 1,
        
"flash" => 1,
        
"youtube" => 1,
        
"mp3" => 0,
        
"wmp" => 0,
        
// If other module is used, please modify the following detection and 'link' in /wiki/config.php
        
"wiki" => is_dir(XOOPS_ROOT_PATH '/modules/mediawiki/'),
        
"mms" => 0,
        
"rtsp" => 0,
        
"soundcloud" => 1,
        
"ul" => 1,
        
"li" => 1),



now you should be able to use the SoundCloud bbcode.




43
iHackCode
Re: Please vote for my site

I Also Voted



44
iHackCode
Re: Help to add a memberGroup test

alain01 the logic doesn't look correct, and I would use the $xoopsUser object to keep it consistent.

Try this.
// XOOPS 
// 1 : webmasters group
// 2 : members group
// 3 : anonymous group
// 4 : your 1st custom group
// ...
global $xoopsUser;
$allowed_groups_upload=array(1,2); // id des groupes autorisés en upload 
$allowed_groups_createfolder=array(1); // id des groupes autorisés create folder 
$upload_files false;
$create_folders false;

if (
is_object($xoopsUser)) {   
   
$usergroups $xoopsUser->getGroups();    
   
$result_upload array_intersect($usergroups$allowed_groups_upload);  
   
   if(!empty(
$result_upload)){  
      
$upload_files true;  
   }
   
   
$result_createfolder array_intersect($usergroups$allowed_groups_createfolder);  
   
   if(!empty(
$result_createfolder)){  
      
$create_folders true;  
   }

// XOOPS



45
iHackCode
Re: XOOPS is back, and with a vengeance! :)

My only free time is the weekend. :(
CBB / LatestNews / Publisher / XM-Spotlight

(ノ◕ヮ◕)ノ*:・゚✧



46
iHackCode
Re: i was just buying cigarettes, did i miss something?

Sorry we ran out of coffee a few years ago, all we have left is beer.

oh and you may not know me, but I remember you from years ago. When I saw you post a few days ago and I was like. Whoa!



47
iHackCode
Re: Problem system_redirect.html

So I think the issue that Tatane is explaining is that if you delete the default theme from XOOPS. That the issue is that the system_redirect function is not showing the redirect correctly in the system administration but shows up okay everywhere else.

It is probably related to thishttp://sourceforge.net/p/xoops/svn/HEAD/tree/XoopsCore/releases/2.5.6/htdocs/include/functions.php#l577

It looks like its looking for that system_redirect.html template in the default theme.



48
iHackCode
Re: To BlueStocking mailbox from Kris_fr.

I guess it's time to get back to work.



49
iHackCode
Re: Merry Christmas & Happy New Year 2013 XOOPsers

Happy New Year.



50
iHackCode
Re: Xoops 2.5.5 bug in "turn site off" page?

the system/templates/system_siteclosed.html template is using browse.php?xoops.css, but i believe that is used for including files from the xoops_lib folder (and that is causing the error).

I would just edit the system_siteclosed.html file and replace that line that includes the xoops.css with.

<link rel="stylesheet" type="text/css" media="all" title="Style sheet" href="<{xoAppUrl xoops.css}>" />






TopTop
« 1 2 3 4 (5) 6 7 8 ... 93 »



Login

Who's Online

241 user(s) are online (161 user(s) are browsing Support Forums)


Members: 0


Guests: 241


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