PEAK XOOPS - smartfaq 1.08 & tellafriend in englishin japanese

smartfaq 1.08 & tellafriend

  • You cannot open a new topic into this forum
  • Guests cannot post into this forum
Previous post - Next post | Parent - Children.1 | Posted on 2007/10/30 0:23
xavhmn  上等兵 From: Athis mons, france  Posts: 36
How to add tellafriend smartfaq 1.08 has?
Votes:1 Average:10.00
Previous post - Next post | Parent - Children.1 .2 | Posted on 2007/10/30 13:26
GIJOE  先任軍曹   Posts: 4110
Quote:

xavhmn wrotes:
How to add tellafriend smartfaq 1.08 has?
I've never used modules from SmartFactory.

But a user post how to apply tellafriend into smartsection.
(He also advices smartfaq is the same as smartsection.)h

edit the template of "smart*_item.html"
<a href="<{$mail_link|xoops_tellafriend}>">
<img src='images/links/tellafriend.gif' alt='tell a friend' />
</a>
Votes:2 Average:5.00
Previous post - Next post | Parent - Children.1 | Posted on 2007/10/30 15:10
xavhmn  上等兵 From: Athis mons, france  Posts: 36
In fact it is different, in templates, I sai to make, but there it is in a file php.

// Email button
	$maillink = 'mailto:?subject=' . sprintf(_MD_SF_INTARTICLE, $xoopsConfig['sitename']) . '&amp;body=' . sprintf(_MD_SF_INTARTFOUND, $xoopsConfig['sitename']) . ':  ' . $modulePath . 'faq.php?faqid=' . $faqid;
	$adminLinks .= "<a href=\"" . $maillink . "\"><img src='" . $modulePath . "images/links/friend.gif' title='" . _MD_SF_MAIL . "' alt='" . _MD_SF_MAIL . "'/></a>";
	$adminLinks .= " ";

I did not find the solution
Votes:2 Average:5.00
Previous post - Next post | Parent - Children.1 | Posted on 2007/10/31 5:05
GIJOE  先任軍曹   Posts: 4110
I never advise you to hack php file.
Just edit a template. (not a file)
Votes:1 Average:10.00
Previous post - Next post | Parent - Children.1 | Posted on 2007/10/31 15:07 | Last modified
xavhmn  上等兵 From: Athis mons, france  Posts: 36
I know, I think of the same thing(matter), but the programming of this module oblige us to make him(it), because the definition of the e-mail is in the file php and meets itself in a variable mixed with the impression(printing), the edition(publishing), etc....

Look at the complete code of the function(office):
function sf_getAdminLinks($faqid = 0, $open=false)
{
	global $xoopsUser, $xoopsModule, $xoopsModuleConfig, $xoopsConfig;
	$adminLinks = '';
	$modulePath = XOOPS_URL . "/modules/" . $xoopsModule->dirname() . "/";
    $page = $open? 'question.php' : 'faq.php';
	if ($xoopsUser && $xoopsUser->isAdmin($xoopsModule->getVar('mid'))) {
		// Edit button
		$adminLinks .= "<a href='" . $modulePath . "admin/$page?op=mod&amp;faqid=" . $faqid . "'><img src='" . $modulePath . "images/links/edit.gif'" . " title='" . _MD_SF_EDIT . "' alt='" . _MD_SF_EDIT . "'/></a>";
		$adminLinks .= " ";
		// Delete button
		$adminLinks .= "<a href='" . $modulePath . "admin/$page?op=del&amp;faqid=" . $faqid . "'><img src='" . $modulePath . "images/links/delete.gif'" . " title='" . _MD_SF_DELETE . "' alt='" . _MD_SF_DELETE . "'/></a>";
		$adminLinks .= " ";
	}
	// Print button
	$adminLinks .= "<a href='" . $modulePath . "print.php?faqid=" . $faqid . "'><img src='" . $modulePath . "images/links/print.gif' title='" . _MD_SF_PRINT . "' alt='" . _MD_SF_PRINT . "'/></a>";
	$adminLinks .= " ";
	// Email button
	$maillink = 'mailto:?subject=' . sprintf(_MD_SF_INTARTICLE, $xoopsConfig['sitename']) . '&amp;body=' . sprintf(_MD_SF_INTARTFOUND, $xoopsConfig['sitename']) . ':  ' . $modulePath . 'faq.php?faqid=' . $faqid;
	$adminLinks .= "<a href=\"" . $maillink . "\"><img src='" . $modulePath . "images/links/friend.gif' title='" . _MD_SF_MAIL . "' alt='" . _MD_SF_MAIL . "'/></a>";
	$adminLinks .= " ";
	// Submit New Answer button
	if (($xoopsModuleConfig['allownewanswer']) && (is_object($xoopsUser) || $xoopsModuleConfig['anonpost'])) {
		$adminLinks .= "<a href='" . $modulePath . "answer.php?faqid=" . $faqid . "'><img src='" . $modulePath . "images/links/newanswer.gif' title='" . _MD_SF_SUBMITANSWER . "' alt='" . _MD_SF_SUBMITANSWER . "'/></a>";
		$adminLinks .= " ";
	}

	return $adminLinks;
}
Votes:3 Average:6.67
Previous post - Next post | Parent - Children.1 | Posted on 2007/11/1 5:45
xavhmn  上等兵 From: Athis mons, france  Posts: 36
resolved

replace:
$maillink = 'mailto:?subject=' . sprintf(_MD_SF_INTARTICLE, $xoopsConfig['sitename']) . '&amp;body=' . sprintf(_MD_SF_INTARTFOUND, $xoopsConfig['sitename']) . ':  ' . $modulePath . 'faq.php?faqid=' . $faqid;

by
$maillink = XOOPS_URL.'/modules/tellafriend/index.php?target_uri=' . $modulePath . 'faq.php?faqid=' . $faqid. '&subject='. sprintf(_MD_SF_INTARTICLE, $xoopsConfig['sitename']);
Votes:5 Average:8.00

none Re: smartfaq 1.08 & tellafriend

msg# 1.1.1.1.1.1.1
Previous post - Next post | Parent - Children.1 | Posted on 2007/11/1 6:19 | Last modified
GIJOE  先任軍曹   Posts: 4110
The reporter told me smartfaq assigns <{$mail_link}>.
Then I still think you need not hack the source codes...

Anyway, I don't have time to confirm that.
Votes:1 Average:10.00
Previous post - Next post | Parent - Children.1 | Posted on 2007/11/2 5:41
etupirka  二等兵   Posts: 2
こんにちは、GIJOEさん。

Quote:

GIJOE wrotes:

edit the template of "smart*_item.html"
<a href="<{$mail_link|xoops_tellafriend}>">
<img src='images/links/tellafriend.gif' alt='tell a friend' />
</a>


smart*_item.htmlなるテンプレートはないですね。


実際に使われているのはsmartfaq_singlefaq.htmlで、mail_linkは確かにアサインされてるはずですが、テンプレートに見あたりませんでした。

「友達に知らせる」という項目は、FAQの編集・削除などの処理系等と一緒に、1つまとめられちゃってるみたいです。


実際に運用しているモジュールじゃないので、これ以上詳しく見ていませんが、やはりハックするのが適切のようでした。


以上報告までに(って、GIJOEさん本人にとってはあんまり意味のなさそうな情報ですが)。
Votes:2 Average:5.00

none Re: smartfaq 1.08 & tellafriend

msg# 1.1.1.1.1.1.1.1
Previous post - Next post | Parent - Children.1 | Posted on 2007/11/4 17:44
xavhmn  上等兵 From: Athis mons, france  Posts: 36
The file about which you speak ( smartfaq_item.html ) does not exist. The link towards the email is only coded in the file include/functions.php in the template ( smartfaq_singlefaq.html ), there is only:
<span style="float: right; text-align: right;"><{$faq.adminlink}></span>

It is the only code corresponding to the email coded in the php. In templates, there is nothing towards the email.
Votes:1 Average:10.00
Previous post - Next post | Parent - Children.1 | Posted on 2007/11/6 6:16 | Last modified
GIJOE  先任軍曹   Posts: 4110
etupirkaさん、こんにちは。

Quote:

実際に使われているのはsmartfaq_singlefaq.htmlで、mail_linkは確かにアサインされてるはずですが、テンプレートに見あたりませんでした。

私の理解では、テンプレートでは利用していないけど、<{$mail_link}>のアサインはされてる、というものでした。

デフォルトテンプレート上の記述は、それらがまとめられた <{$admin_link}> ですが、<{$mail_link}> と書いたら表示されません?

# ぐだぐだ書く前にインストールしろよ、という話もありますが
Votes:2 Average:5.00

none Re: smartfaq 1.08 & tellafriend

msg# 1.1.1.1.1.1.1.1.1
Previous post - Next post | Parent - No child | Posted on 2007/11/6 6:20 | Last modified
GIJOE  先任軍曹   Posts: 4110
hi xavhmn.

By synthesizing informations from choromo and etupirka,
The template you should edit is:

smartfaq_singlefaq.html

And <{$mail_link}> is surely assigned in a version.
(Just not used in templates)
Votes:2 Average:10.00
Previous post - Next post | Parent - Children.1 | Posted on 2007/11/8 20:24 | Last modified
etupirka  二等兵   Posts: 2
Quote:

GIJOE wrotes:
デフォルトテンプレート上の記述は、それらがまとめられた <{$admin_link}> ですが、<{$mail_link}> と書いたら表示されません?

アサインされてるし、もちろん利用可能です。


でも、<{$mail_link}> なら取り替えるだけでOKでしたが、<{$admin_link}>は他にも「削除」「編集」「印刷」「回答投稿」と色々持ってますので、これは消せないのですよね〜。そうすると<{$admin_link}>が持ってるtellafriendを利用していない「友達に知らせる」が残っちゃうんですよ。


PHPをハックしなくても確かにtellafriendは利用出来ますが、私が「ハックするのが適切」と書いたのはそういう意味でした。


Quote:

GIJOE wrotes:
# ぐだぐだ書く前にインストールしろよ、という話もありますが

むしろ、英語で書けば良かったかなぁ、と反省しています。
Votes:1 Average:10.00
Previous post - Next post | Parent - No child | Posted on 2007/11/10 6:58
GIJOE  先任軍曹   Posts: 4110
etupirka さん、こんにちは。

Quote:

アサインされてるし、もちろん利用可能です。
でも、<{$mail_link}> なら取り替えるだけでOKでしたが、<{$admin_link}>は他にも「削除」「編集」「印刷」「回答投稿」と色々持ってますので、これは消せないのですよね〜。そうすると<{$admin_link}>が持ってるtellafriendを利用していない「友達に知らせる」が残っちゃうんですよ。
なるほど〜。
だから、choromoさんは、その画像を1x1の透明ピクセルに置き換えるって書いていたんですね。
<{$admin_link}>内の画像を見えなくすれば事実上問題ないし、あとは、<{$mail_link}> を使って記述するだけ、という話だったわけですね。

Quote:
PHPをハックしなくても確かにtellafriendは利用出来ますが、私が「ハックするのが適切」と書いたのはそういう意味でした。
こっちも納得です。

個人的には、それでもテンプレート書き換えにとどめた方がいいかな、とは思います。
<{admin_link|regex_replace:"#<img.*/>#iU":""}>
みたいに、無理矢理消してしまう、とか。(それはそれでナニですが)
Votes:1 Average:10.00

  Advanced search


Login
Username or e-mail:

Password:

Remember Me

Lost Password?

Register now!