Custom Action Mod

Started by Norv, May 09, 2006, 08:35:29 PM

Previous topic - Next topic

MissyNL

have done that... now it says this:

Parse error: syntax error, unexpected '<' in /home/bimeiden/domains/bimeiden.nl/public_html/Themes/default/CustomAction.template.php(9) : eval()'d code on line 26

It is the part where <html> begins... :(
Sorry for my poor English, but i think it's probably better then your Dutch :)

MissyNL

hello.. sorry for bumping this up.. but i really want to integrate the chat.. so if anyone can help me.. then please :)
Sorry for my poor English, but i think it's probably better then your Dutch :)

Darkorical

#442
try pasting this code exactly in your custom action and make your page title "123 Flash Chat"


if (!defined("SMF")) define("SMF", "1");
include('Settings.php');
include('Sources/Load.php');
include('Sources/Subs-Auth.php');
include("mysql4.php");
$_COOKIE[$cookiename] = stripslashes($_COOKIE[$cookiename]);
echo $_cookiename;
list ($ID_MEMBER, $password) = @unserialize($_COOKIE[$cookiename]);
$username_field = "memberName";
$password_field = "passwd";
$usertable  = $db_prefix."members ";
$db = new sql_db($db_server, $db_user, $db_passwd, $db_name, false);
$sql = "SELECT " . $username_field.",".$password_field.
" FROM " . $usertable . "
WHERE ID_MEMBER = ".$ID_MEMBER;

$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$username = $row[$username_field];
$password = $row[$password_field];
$user = '';
if($username !=''){
$user = '&init_user='.$username.'&init_password='. $password;
}
echo'
<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/ swflash.cab#version=6,0,19,0" WIDTH="634" HEIGHT="476">
<PARAM NAME=movie VALUE="client/123flashchat.swf?init_room=1'.$user.'">
<PARAM NAME=quality VALUE="high"> <PARAM NAME="menu" value="false">
<EMBED src="client/123flashchat.swf?init_room=1'. $user.'" quality=high menu=false WIDTH="634" HEIGHT="476" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer">
</EMBED>
</OBJECT>';


remember DO NOT ADD <? or ?>!

MissyNL

This time it gave a total other error then what i have seen so far....


Fatal error: Cannot redeclare reloadsettings() (previously declared in /xxx/xxx/xxx/xxx/xxx/Sources/Load.php:140) in /xxx/xxx/xxx/xxx/xxx/Sources/Load.php on line 342


weird....

thanks for the reply tho!  :D
Sorry for my poor English, but i think it's probably better then your Dutch :)

Darkorical

okie dokie I got that same error when I tested it on my site  (but I didnt have the rest of the stuff so I thought it might fix it for someone with all the files so Ill look at it again and see what I can come up with

Darkorical

I dont have a clue if this will work or not but give it a shot and see what happens Ill look more into it tommarow


if (!defined("SMF")) define("SMF", "1");
global $user_info;
include("mysql4.php");
$user = '';
if($username !=''){

$user = '&init_user='.$context['user']['name'].'&init_password=pass';

}


echo'
<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/ swflash.cab#version=6,0,19,0" WIDTH="634" HEIGHT="476">
<PARAM NAME=movie VALUE="client/123flashchat.swf?init_room=1'.$user.'">
<PARAM NAME=quality VALUE="high"> <PARAM NAME="menu" value="false">
<EMBED src="client/123flashchat.swf?init_room=1'.$user.'" quality=high menu=false WIDTH="634" HEIGHT="476" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer">
</EMBED>
</OBJECT>';

MissyNL

It works!!!!  Freaking awsome!!! Thank you so much!

The only thing is that the members are not automatically logged in, so they have to fill in there password. But i can live with that  :D
Sorry for my poor English, but i think it's probably better then your Dutch :)

MissyNL

#447
I also have found out a nother problem... i have my own theme with a pulldown menu. Now the pull down menu is not visable, since it go's "behind" the page. What can i do?

And i also have the same version chat, but an avatar chat. Now i have only changed the .swf name and it works, however.. i have to erase the


if (!defined("SMF")) define("SMF", "1");
global $user_info;
include("mysql4.php");
$user = '';
if($username !=''){
   
   $user = '&init_user='.$context['user']['name'].'&init_password=pass';
   
}


part.. since this line is showing above the chat.
Sorry for my poor English, but i think it's probably better then your Dutch :)

eslao

Quote from: NIBOGO on February 13, 2009, 06:51:41 PM
The MOD works pretty cool on SMF 2.0 RC1 , You just have to go:

yourforum.com/index.php?action=admin;area=featuresettings;sa=action

how ?

itweb

Let's say a custom action is html code but it works with a script that uses some files in folders.

Where should these folders be placed inside the SMF root, so the are called properly without modifying the paths.

Folders call for /something/abc.js
so they call the relative location

What would be a relative location for the custom action? Theme folder? Sources?

Fooz

I get "Test Failed" - Execute Modification on ./Sources/Admin.php

I have SimplePortal 2.2.2 installed on my SMF 2.0 RC1-1

The modification on the file should be:


Find [Select]
'pruning' => array($txt['pruning_title']),
Replace [Select]
'pruning' => array($txt['pruning_title']),
'action' => array($txt['custom_action_shorttitle']),


But as far as I can see the string we want to replace should be

'pruning' => array($txt['pruning_title'], 'admin_forum'),

Not sure what will happen if i just continue with the install and replace the line in question manually...

Please help me out a bit :)

Chamaeleon

SMF 2.0 RC1-1 + SMF 2.0 RC1-2

Admin.php

Find

'profile' => array($txt['custom_profile_shorttitle'], 'enabled' => in_array('cp', $context['admin_features'])),

Replace with


'profile' => array($txt['custom_profile_shorttitle'], 'enabled' => in_array('cp', $context['admin_features'])),
'action' => array($txt['custom_action_shorttitle'], 'admin_forum'),

SlammedDime

Not sure if Winrules is actively keeping this updated or not... but I made some changes to the back end so it was easier to edit code, including adding a javascript syntax highlighter/editor...

SlammedDime
Former Lead Customizer
BitBucket Projects
GeekStorage.com Hosting
                      My Mods
SimpleSEF
Ajax Quick Reply
Sitemap
more...
                     

RedCairo

Quote from: MissyNL on May 05, 2009, 03:10:26 PM
This time it gave a total other error then what i have seen so far....


Fatal error: Cannot redeclare reloadsettings() (previously declared in /xxx/xxx/xxx/xxx/xxx/Sources/Load.php:140) in /xxx/xxx/xxx/xxx/xxx/Sources/Load.php on line 342


thanks for the reply tho!  :D


I hate to gripe but apparently this got solved and nobody posted HOW, so of course after all this reading I finally find the same problem I'm having but no solution.  OK moving on . . . . what is the solution to this error?  Thanks.

Palyne

SlammedDime

Anything that is redeclared means the function has been, as the error says, declared more than once, which is not possible in PHP...

You should almost never use include() or require()... you should use include_once() or require_once() instead.
SlammedDime
Former Lead Customizer
BitBucket Projects
GeekStorage.com Hosting
                      My Mods
SimpleSEF
Ajax Quick Reply
Sitemap
more...
                     

dreaded

Hello, I have installed the Custom tab, which i intend using it for Live Radio. I have another site that i have intergrated the radios in with a pop up javascript and i believe this Custom Ad Mod could help me intergrate that javascript into my forum via the Radio Custom Tab made.

But to be honest, i just don't where to paste my javascript code so that when someone clicks on the Radio Custom Tab, the radio stations will pop up.

Could someone pls help me out?

Here's my js code:<script language="JavaScript">!--
function popUp {
window.popUp("Streams/Peacefm.html","Window1","menubar=no,width=470,height=490,toolbar=no,resizable=no,scrollbars=no");
}
/</script>
     
     
      <p><a href="javascript:void();" onclick="win1(); return true;"> <b><img style="width: 98px; height: 30px;" alt="" src="custom.gif"><br>


      </b></a>


Thnx.

PS: Am using the babylon theme 1.1.10


AlenNS

Quote from: Chamaeleon on July 15, 2009, 11:19:16 AM
SMF 2.0 RC1-1 + SMF 2.0 RC1-2

Admin.php

Find

'profile' => array($txt['custom_profile_shorttitle'], 'enabled' => in_array('cp', $context['admin_features'])),

Replace with


'profile' => array($txt['custom_profile_shorttitle'], 'enabled' => in_array('cp', $context['admin_features'])),
'action' => array($txt['custom_action_shorttitle'], 'admin_forum'),

Works excellent!

c23_Mike

Hi there !

It cannot be installed on RC2, are you working on an update?

Not to find in Sources/Admin.php
Quote'pruning' => array($txt['pruning_title']),

and

not to find in Sources/Subs.php

Quote$load_menu_js = false;

So long, Mike

http://www.c23.at
c23 - DER Computer Club
~ never play alone ~

Chamaeleon

Quote from: c23_Mike on October 18, 2009, 04:06:15 PM
Hi there !

It cannot be installed on RC2, are you working on an update?

Not to find in Sources/Admin.php
Quote'pruning' => array($txt['pruning_title']),

and

not to find in Sources/Subs.php

Quote$load_menu_js = false;



SMF 2.0 RC2

Quote from: Chamaeleon on July 15, 2009, 11:19:16 AM

Admin.php

Find

'profile' => array($txt['custom_profile_shorttitle'], 'enabled' => in_array('cp', $context['admin_features'])),

Replace with


'profile' => array($txt['custom_profile_shorttitle'], 'enabled' => in_array('cp', $context['admin_features'])),
'action' => array($txt['custom_action_shorttitle'], 'admin_forum'),


Sources/Subs.php:

Find

// Now we put the buttons in the context so the theme can use them.

Replace with

// Any custom action buttons?
$ca_buttons = unserialize($modSettings['ca_menu_cache']);
foreach ($ca_buttons as $button)
{
$buttons[$button[0]] = array(
'title' => $button[1],
'href' => $scripturl . '?action=' . $button[0],
'show' => $button[2] ? allowedTo($button[2]) : true,
'sub_buttons' => array(
),
'is_last' => true,
);
}

// Now we put the buttons in the context so the theme can use them.

Advertisement: