msg# 1
xavhmn
From: Athis mons, france
Posts: 36
How to add tellafriend smartfaq 1.08 has?
Votes:1
Average:10.00
msg# 1.1
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
msg# 1.1.1
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']) . '&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
msg# 1.1.1.1
I never advise you to hack php file.
Just edit a template. (not a file)
Votes:1
Average:10.00
msg# 1.1.1.1.1
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&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&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']) . '&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
msg# 1.1.1.1.1.1
xavhmn
From: Athis mons, france
Posts: 36
resolved
replace:
$maillink = 'mailto:?subject=' . sprintf(_MD_SF_INTARTICLE, $xoopsConfig['sitename']) . '&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
msg# 1.1.1.1.1.1.1
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
msg# 1.1.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
msg# 1.1.1.1.1.1.1.1
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
msg# 1.1.2.1
etupirkaさん、こんにちは。
Quote:
実際に使われているのはsmartfaq_singlefaq.htmlで、mail_linkは確かにアサインされてるはずですが、テンプレートに見あたりませんでした。
私の理解では、テンプレートでは利用していないけど、<{$mail_link}>のアサインはされてる、というものでした。
デフォルトテンプレート上の記述は、それらがまとめられた <{$admin_link}> ですが、<{$mail_link}> と書いたら表示されません?
# ぐだぐだ書く前にインストールしろよ、という話もありますが
Votes:2
Average:5.00
msg# 1.1.1.1.1.1.1.1.1
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
msg# 1.1.2.1.1
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
msg# 1.1.2.1.1.1
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