What it does:
When you click the 'bury' button, a choice of reasons will appear below the links (the same as when you click "Add this link to..."). When you click on one of the reasons, the story is buried as normal, but the "Live" page will show the action as "buried R1" instead of "report". I use R1-R7 to identify which reason was chosen. I then explain these on my FAQ so disgruntled users can find out why their story was buried.
See the attached screenshots to understand the results.
What it doesn't do:
It doesn't send any emails or leave any messages on the buried story. The only way for people to know the reason a story was buried is to check the "Live" page.
UPDATE: See my later post (#8) for how I've extended the mod to show a flag next to buried stories.
Tested on:
Pligg 9.8.2 using voting method 1. My template is "moderno-orange", but it should work for yget.
UPDATE: I've now tested this on .9.9.5 and it works.
Please read all these instructions before attempting this modification, just in case I've done something wrong. I'm just a novice playing with the code! You have been warned!
STEP 1: Create the choices that show when you click "bury"
Open /templates/your_template/link_summary.tpl and find:
Code:
{if $link_shakebox_currentuser_votes eq 0 && $link_shakebox_currentuser_reports eq 0}
<span id="xreport-{$link_shakebox_index}"> <img src="{$my_pligg_base}/templates/{$the_template}/images/error.png" align="absmiddle" /> <a href="javascript:{$link_shakebox_javascript_report}">{#PLIGG_Visual_Vote_Bury#}</a></span>
{/if}
Code:
{if $link_shakebox_currentuser_votes eq 0 && $link_shakebox_currentuser_reports eq 0}
<span id="xreport-{$link_shakebox_index}">
<img src="{$my_pligg_base}/templates/{$the_template}/images/error.png" align="absmiddle" /> <a href="javascript://" onclick="var reportdisplay=document.getElementById('report-{$link_shakebox_index}').style.display ? '' : 'none';document.getElementById('report-{$link_shakebox_index}').style.display = reportdisplay;" title="Click for 'bury' options"> {#PLIGG_Visual_Vote_Bury#}</a>
</span>
{/if}
Code:
{if $link_shakebox_currentuser_votes eq 0 && $link_shakebox_currentuser_reports eq 0}
<span id="report-{$link_shakebox_index}" style="display:none"><br />{#PLIGG_Visual_LS_Bury#} <br />
<a href="javascript:{$link_shakebox_javascript_report1}">{#PLIGG_Visual_Vote_Bury_1#}</a>
| <a href="javascript:{$link_shakebox_javascript_report2}">{#PLIGG_Visual_Vote_Bury_2#}</a>
| <a href="javascript:{$link_shakebox_javascript_report3}">{#PLIGG_Visual_Vote_Bury_3#}</a>
| <a href="javascript:{$link_shakebox_javascript_report4}">{#PLIGG_Visual_Vote_Bury_4#}</a>
| <a href="javascript:{$link_shakebox_javascript_report5}">{#PLIGG_Visual_Vote_Bury_5#}</a>
| <a href="javascript:{$link_shakebox_javascript_report6}">{#PLIGG_Visual_Vote_Bury_6#}</a>
| <a href="javascript:{$link_shakebox_javascript_report7}">{#PLIGG_Visual_Vote_Bury_7#}</a>
</span>
{/if}
Open /libs/lang.conf, find "PLIGG_Visual_LS_AddTo" and add our own "LS_Bury" below it as follows:
Code:
//<SECTION>LINK_SUMMARY</SECTION><ADDED>0.70</ADDED> PLIGG_Visual_LS_AddTo = "Add to: " //<SECTION>LINK_SUMMARY</SECTION><ADDED>0.70</ADDED> PLIGG_Visual_LS_Bury = "Reason for burying this story: "
Code:
//<SECTION>LINK_SUMMARY</SECTION><ADDED>0.5</ADDED> PLIGG_Visual_Vote_Bury = "Bury" //<SECTION>LINK_SUMMARY</SECTION><ADDED>0.5</ADDED> PLIGG_Visual_Vote_Bury_1 = "Spam" //<SECTION>LINK_SUMMARY</SECTION><ADDED>0.5</ADDED> PLIGG_Visual_Vote_Bury_2 = "Inappropriate" //<SECTION>LINK_SUMMARY</SECTION><ADDED>0.5</ADDED> PLIGG_Visual_Vote_Bury_3 = "Broken Link" //<SECTION>LINK_SUMMARY</SECTION><ADDED>0.5</ADDED> PLIGG_Visual_Vote_Bury_4 = "Duplicate" //<SECTION>LINK_SUMMARY</SECTION><ADDED>0.5</ADDED> PLIGG_Visual_Vote_Bury_5 = "Inaccurate" //<SECTION>LINK_SUMMARY</SECTION><ADDED>0.5</ADDED> PLIGG_Visual_Vote_Bury_6 = "Wrong Category" //<SECTION>LINK_SUMMARY</SECTION><ADDED>0.5</ADDED> PLIGG_Visual_Vote_Bury_7 = "Poor"
Open /libs/link.php and find:
Code:
$jsreportlink = "vote($current_user->user_id,$this->id,$link_index," . "'" . md5($current_user->user_id.$this->randkey) . "',-10)";
Code:
$jsreportlink1 = "vote($current_user->user_id,$this->id,$link_index," . "'" . md5($current_user->user_id.$this->randkey) . "',-11)"; $jsreportlink2 = "vote($current_user->user_id,$this->id,$link_index," . "'" . md5($current_user->user_id.$this->randkey) . "',-12)"; $jsreportlink3 = "vote($current_user->user_id,$this->id,$link_index," . "'" . md5($current_user->user_id.$this->randkey) . "',-13)"; $jsreportlink4 = "vote($current_user->user_id,$this->id,$link_index," . "'" . md5($current_user->user_id.$this->randkey) . "',-14)"; $jsreportlink5 = "vote($current_user->user_id,$this->id,$link_index," . "'" . md5($current_user->user_id.$this->randkey) . "',-15)"; $jsreportlink6 = "vote($current_user->user_id,$this->id,$link_index," . "'" . md5($current_user->user_id.$this->randkey) . "',-16)"; $jsreportlink7 = "vote($current_user->user_id,$this->id,$link_index," . "'" . md5($current_user->user_id.$this->randkey) . "',-17)";
Code:
$smarty->assign('link_shakebox_javascript_report', $jsreportlink);
Code:
$smarty->assign('link_shakebox_javascript_report1', $jsreportlink1);
$smarty->assign('link_shakebox_javascript_report2', $jsreportlink2);
$smarty->assign('link_shakebox_javascript_report3', $jsreportlink3);
$smarty->assign('link_shakebox_javascript_report4', $jsreportlink4);
$smarty->assign('link_shakebox_javascript_report5', $jsreportlink5);
$smarty->assign('link_shakebox_javascript_report6', $jsreportlink6);
$smarty->assign('link_shakebox_javascript_report7', $jsreportlink7);
I got really stuck with buried links getting random vote_values instead of the -11 to -17 that I specified. It was driving me crazy! Eventually, I found that karma was affecting the values. I couldn't see the need for karma here, so I just commented out the guilty lines in the insert_vote function, as follows:
Code:
// if($value<10) {$vote->value=($anon_karma/10)*$value;}
if($value<10) {$vote->value=$value;} Code:
// if($value<10) {$vote->value = ($dbuser->karma/10)*$value;}
if($value<10) {$vote->value = $value;} Open /live2.php and find:
Code:
if ($event->vote_value < 0) {
$type = 'report';
$who = $user;
}
Code:
if (($event->vote_value < 0) && ($event->vote_value > -11)) {
$type = 'buried';
$who = $user;
}
else if ($event->vote_value == -11) {
$type = 'buried R1';
$who = $user;
}
else if ($event->vote_value == -12) {
$type = 'buried R2';
$who = $user;
}
else if ($event->vote_value == -13) {
$type = 'buried R3';
$who = $user;
}
else if ($event->vote_value == -14) {
$type = 'buried R4';
$who = $user;
}
else if ($event->vote_value == -15) {
$type = 'buried R5';
$who = $user;
}
else if ($event->vote_value == -16) {
$type = 'buried R6';
$who = $user;
}
else if ($event->vote_value == -17) {
$type = 'buried R7';
$who = $user;
}
else if ($event->vote_value < -17) {
$type = 'buried';
$who = $user;
}
/templates/your_template/link_summary.tpl
/libs/lang.conf
/libs/link.php
/live2.php
and cross your fingers!





Linear Mode

