Autor Zpráva
lmdizajn
Profil *
Caute,
kedysi som robil ešte v joomle 1.0 a teraz ako som prešiel na 1.5, tak neviem či som niečo spravne nepochopil, alebo sa v tom už nevyznam alebo kde mam chybu. Mam napisany script na modul a asi je tam niečo blbo, lebo ked dam modul publikovat, tak mi ho vôbec neukaže. Nahodou keby niekto videl chybu a vedel mi ju opravit alebo aspon teoreticky, bol by som vdačny... Diky
Prikladam php kod:
 
<?php
 
// no direct access
// defined( '_JEXEC' ) or die( 'Restricted access' );

function lmdfb( $params )
    {
	$width = $params->get('widthfb', '200');
	$action=$pluginParams->get('action','like');
	if ($showFaces=="0") $show_faces="false";
	if ($showFaces=="1") $show_faces="true";
	$colorScheme = $params->get('colorschemefb', 'light');
	$layout = $params->get('layout', 'standard');
	$lang=&JFactory::getLanguage();
	$lang_tag=$lang->getTag();
	$lang_tag=str_replace("-","_",$lang_tag);

// URL own

	$adress = $params->get('URLadress', 'http://www.lmdizajn.com');
	$encodedURL = urlencode($adress);

	if ($URLown=="0") $curl = $encodedURL;

// URL automatic

	$uri =& JURI::getInstance();
	
	if ($URLown=="1") $curl = $uri->toString();

// full

	$url = "<script src=\"http://connect.facebook.net/".$lang_tag."/all.js#xfbml=1\"></script><fb:like href=\"".$curl."\" layout=\"".$layout."\" show_faces=\"".$showFaces."\" width=\"".$width."\" action=\"".$action."\" colorscheme=\"".$colorScheme."\"></fb:like>";

	echo $url;
}

echo $url;

?>

 

a xml kod:
 
<?xml version="1.0" encoding="utf-8"?>
<install type="module" version="1.5.0" method="upgrade">
	<name>LMD FB Module</name>
	<creationDate>3 May 2011</creationDate>
	<author>LMDizajn</author>
	<copyright>lmdizajn.com</copyright>
	<license>GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html</license>;
	<authorEmail>@</authorEmail>
	<authorUrl>A</authorUrl>
	<version>1.0</version>
	<releaseDate>A</releaseDate>
	<releaseType>A</releaseType>
	<downloadUrl>A</downloadUrl>
	<description>DESCRIPTION</description>
	<files>
		<filename module="mod_lmd_fb">mod_lmd_fb.php</filename>
		<filename>mod_lmd_fb.xml</filename>
		<filename>index.html</filename>
	</files>
	<params>
		<param name="layout" type="list" default="standard" label="Layout" description="">
			<option value="standard">standard</option>
			<option value="button_count">button_count</option>
			<option value="box_count">box_count</option>
		</param>
		<param name="show_faces" type="radio" default="0" label="Show Faces" description="">
			<option value="0">No</option>
			<option value="1">Yes</option>
		</param>
		<param name="widthfb" type="text" size="20" default="200" label="Width" description=""/>
		<param name="action" type="list" default="like" label="Action" description="">
			<option value="like">like</option>
			<option value="recommend">recommend</option>
		</param>
		<param name="colorschemefb" type="list" default="light" label="Color Scheme" description="">
			<option value="light">light</option>
			<option value="dark">dark</option>
		</param>
		<param name="URLown" type="radio" default="0" label="Own link?" description="Do you want to work with own web link?">
			<option value="0">No</option>
			<option value="1">Yes</option>
		</param>
		<param name="URLadress" type="text" default="http://www.lmdizajn.com" label="Link on" description="Everytime the script was linking on your url adress" size="40" />
	</params>
	<params group="other">
		<param name="moduleclass_sfx" type="text" default="" label="Module Class Suffix" description="PARAMMODULECLASSSUFFIX" />
	</params>
</install>

 
H13
Profil
Ahoj,

Xml vypadá v pohodě, tohle je tuším už zbytečný (možná, každopádně to není problém):
<releaseDate>A</releaseDate>
    <releaseType>A</releaseType>
    <downloadUrl>A</downloadUrl>


Nainstaloval jsi ten modul v administraci přes standardní instalační proces, tak aby byl záznam v databázi. Je modul uvedenej v databázi?

Odkomentuj:
// defined( '_JEXEC' ) or die( 'Restricted access' );

kvůli bezpečnosti

Nedávej kód do funkce (zakomentuj):
function lmdfb( $params ) {
}


Zakomentuj oba dva výskyty:
echo $url;


Vytvoř složku tmpl, v ní soubor default.php a do toho vlož echo $url; (taky vytvoř prázdnej index.html kvůli bezpečnosti)

Na poslední řádek po echo $url (kterej jsi zakomentoval) vlož:
require(JModuleHelper::getLayoutPath('mod_lmd_fb'));
lmdizajn
Profil *
Ano nainstalovane to je, index tam mam, ale to s tym tmpl som nevedel. A teda bez funkcie...
Uz mi modul načíta, ale vyhodí mi ten FB tlacitko pre www.facebook.com a za tym chyba - Stránka na http:/// nie je dostupná.
<?php
// LMDizajn FB like button
 
// no direct access
defined( '_JEXEC' ) or die( 'Restricted access' );
 
// FB module from plugin

// function lmdfb( $params ) {
	$width = $params->get('widthfb', '200');
	$action=$params->get('action','like');
	if ($showFaces=="0") $show_faces="false";
	if ($showFaces=="1") $show_faces="true";
	$colorScheme = $params->get('colorschemefb', 'light');
	$layout = $params->get('layout', 'standard');
	$lang=&JFactory::getLanguage();
	$lang_tag=$lang->getTag();
	$lang_tag=str_replace("-","_",$lang_tag);

// URL own
	$adress = $params->get('URLadress', 'http://www.lmdizajn.com');
	$encodedURL = urlencode($adress);

	if ($URLown=="0") $curl = $encodedURL;

// URL automatic
	$uri =& JURI::getInstance();
	
	if ($URLown=="1") $curl = $uri->toString();

// full
	$url = "<script src=\"http://connect.facebook.net/".$lang_tag."/all.js#xfbml=1\"></script><fb:like href=\"".$curl."\" layout=\"".$layout."\" show_faces=\"".$showFaces."\" width=\"".$width."\" action=\"".$action."\" colorscheme=\"".$colorScheme."\"></fb:like>";

// echo $url;

require(JModuleHelper::getLayoutPath('mod_lmd_fb'));

?>

<?xml version="1.0" encoding="utf-8"?>
<install type="module" version="1.5.0" method="upgrade">
	<name>LMD FB Module</name>
	<creationDate>3 May 2011</creationDate>
	<author>LMDizajn</author>
	<copyright>lmdizajn.com</copyright>
	<license>GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html</license>;
	<authorEmail>posta@lmdizajn.com</authorEmail>
	<authorUrl>www.lmdizajn.com</authorUrl>
	<version>1.0</version>
	<description>DESCRIPTION</description>
	<files>
		<filename module="mod_lmd_fb">mod_lmd_fb.php</filename>
		<filename>mod_lmd_fb.xml</filename>
		<filename>index.html</filename>
		<filename>tmpl/default.php</filename>
		<filename>tmpl/index.html</filename>
	</files>
	<params>
		<param name="layout" type="list" default="standard" label="Layout" description="">
			<option value="standard">standard</option>
			<option value="button_count">button_count</option>
			<option value="box_count">box_count</option>
		</param>
		<param name="show_faces" type="radio" default="0" label="Show Faces" description="">
			<option value="0">No</option>
			<option value="1">Yes</option>
		</param>
		<param name="widthfb" type="text" size="20" default="200" label="Width" description=""/>
		<param name="action" type="list" default="like" label="Action" description="">
			<option value="like">like</option>
			<option value="recommend">recommend</option>
		</param>
		<param name="colorschemefb" type="list" default="light" label="Color Scheme" description="">
			<option value="light">light</option>
			<option value="dark">dark</option>
		</param>
		<param name="URLown" type="radio" default="0" label="Own link?" description="Do you want to work with own web link?">
			<option value="0">No</option>
			<option value="1">Yes</option>
		</param>
		<param name="URLadress" type="text" default="http://www.lmdizajn.com" label="Link on" description="Everytime the script was linking on your url adress" size="40" />
	</params>
	<params group="other">
		<param name="moduleclass_sfx" type="text" default="" label="Module Class Suffix" description="PARAMMODULECLASSSUFFIX" />
	</params>
</install>

Vaše odpověď


Prosím používejte diakritiku a interpunkci.

Ochrana proti spamu. Napište prosím číslo dvě-sta čtyřicet-sedm: