Esempio n. 1
0
	$articletag['maillink'] = "<a href='print.php?articleid=".$article->articleid."'><img src='".XOOPS_URL."/modules/".$xoopsModule->dirname()."/images/print.gif' alt='"._WFS_PRINTERFRIENDLY."' /></a> ";
	//$articletag['maillink'] .= "<a href='save.php?articleid=".$article->articleid."'><img src='".XOOPS_URL."/modules/".$xoopsModule->dirname()."/images/download.gif' alt='"._WFS_DOWNLOAD."' /></a> ";

//	$articletag['maillink'] .= "<a target='_top' href='mailto:?subject=".rawurlencode(sprintf(_WFS_INTFILEAT, $xoopsConfig['sitename']))."&body=".rawurlencode(sprintf(_WFS_INTFILEFOUND,$xoopsConfig['sitename']).":  ".XOOPS_URL."/modules/".$xoopsModule->dirname()."/index.php?articleid=".$article->articleid)."'><img src='".XOOPS_URL."/modules/".$xoopsModule->dirname()."/images/friend.gif' alt='"._WFS_TELLAFRIEND."' /></a>";

// tel a frined
	$subject = sprintf(_WFS_INTFILEAT, $xoopsConfig['sitename']);

// bug fix : tel a frined : index.php -> article.php
//	$body = sprintf(_WFS_INTFILEFOUND, $xoopsConfig['sitename'] ).":\n".XOOPS_URL."/modules/".$xoopsModule->dirname()."/index.php?articleid=".$article->articleid;
	$body = sprintf(_WFS_INTFILEFOUND, $xoopsConfig['sitename'] ).":\n".XOOPS_URL."/modules/".$xoopsModule->dirname()."/article.php?articleid=".$article->articleid;

// for japanese environment
// convert EUC-JP to SJIS
	include_once XOOPS_ROOT_PATH.'/modules/'.$xoopsModule->dirname().'/class/base_language.php';
	$lang    = new ConvertLanguage;
	$subject = $lang->convert_telafriend_subject($subject);
	$body    = $lang->convert_telafriend_body($body);

	$subject = rawurlencode($subject);
	$body = rawurlencode($body);
	$articletag['maillink'] .= "<a href=\"mailto:?body=$body&amp;subject=$subject\"><img src='".XOOPS_URL."/modules/".$xoopsModule->dirname()."/images/friend.gif' alt='"._WFS_TELLAFRIEND."' /></a>";

	$articletag['ratelink'] = "<a href='ratefile.php?lid=".$article->articleid."'>"._WFS_RATETHISFILE."</a>";
	$articletag['catlink'] = "<a href='./index.php?category=".$article->categoryid()."'>"._WFS_BACK2CAT."</a><b> | </b><a href='./index.php'>"._WFS_RETURN2INDEX."</a>";
	$articletag['rating'] = "<b>".sprintf(_WFS_RATINGA, number_format($article->rating, 2))."</b>";
	$articletag['votes'] = "<b>(".sprintf(_WFS_NUMVOTES, $article->votes).")</b>";
	$articletag['counter'] = sprintf(_WFS_VIEWS, $counter);
	$articletag['size'] = sprintf(_WFS_ARTSIZE, prettysize(strlen($articletag['maintext'])));
	// assign the article variables to template
	$xoopsTpl->assign('article', $articletag);
Esempio n. 2
0
//                $langdir = XOOPS_ROOT_PATH."/modules/".$xoopsModule->dirname()."/language/".$xoopsConfig['language'];
//        } else {
//                $langdir = XOOPS_ROOT_PATH."/modules/".$xoopsModule->dirname()."/language/english";
//        }
//        include_once($langdir."/convert.php");
//        $dlfilename = WfsConvert::filenameForWin($dlfilename);
//        header("Content-Type: ".$file->getMinetype());
//        header("Content-Length: $size");
//        header("Cache-control: private");
//        header("Content-Disposition: attachment; filename=$dlfilename");
//}

// for japanese environment
// convert when Machintosh
		include_once XOOPS_ROOT_PATH.'/modules/'.$xoopsModule->dirname().'/class/base_language.php';
		$lang       = new ConvertLanguage();
		$browser    = $lang->getBrowser();
		$dlfilename = $lang->convert_download_filename($dlfilename);

if ($browser == 'msie')
{
        header("Content-Type: ".$file->getMinetype());
        header("Content-Length: $size");

        header("Cache-control: private");
        header("Content-Disposition: attachment; filename=$dlfilename");
}

else {  // For Other browsers
		if (preg_match("/[^a-zA-Z0-9_\-\.]/",$dlfilename)) $dlfilename=$fileid.".".$file->getExt();