Example: http://strandalo.us/ , look at the first link and click on the story to see what shows up.
1. Ok, first thing you need to do: convert one of the extra link_field's to INT. I used link_field9 for no particular reason, but you can use whichever you want. Go into your "pligg_links" table and edit the STRUCTURE of link_field9 to be, TYPE: INT, LENGTH: 11, DEFAULT: 0 and save it.
2. Open up /recommend.php. Add the following lines:
Line 80, find $to = ""; and replace it with:
Code:
$db->query("UPDATE " . table_links . " set link_field9=link_field9+1 WHERE link_id=$link->id");
$to = "spambot@yourdomain.com";
Line 101, find $subject = Email_Subject . $link->title; and change it to:
Code:
$subject = '"' . $link->title . '" - ' . $_REQUEST['email_message'];
Code:
$body = "URL: " . $link_url . "\nTitle: " . $link->title . "\nDescription: " . $link->content . "\nUser: " . $current_user->user_login;
Code:
<form name="email_to" method="get" action="{$my_base_url}{$my_pligg_base}/recommend.php">
<fieldset style="width: 100px;">
<legend>Report Spam</legend>
<input type="text" style="display:none" readonly="readonly" name="email_address_1" size = "25" id="email_address_1_{$link_shakebox_index}" value="spambot@strandalo.us">
<p>Type:</p>
<select name="email_message{$link_shakebox_index}" id="email_message{$link_shakebox_index}">
<option value="Spam">Spam
<option value="Duplicate">Duplicate
<option value="Unreleased">Unreleased
<option value="Wrong Platform">Wrong Platform
<option value="Incorrect Date">Incorrect Release Date
<option value="Other">Other Inaccurate Information
</select>
<!--<textarea readonly="readonly" name="email_message{$link_shakebox_index}" id="email_message{$link_shakebox_index}" cols="19" rows="1">User: {$user_logged_in}</textarea>-->
<input type="button" name="email_to_submit" value="Submit" onclick="emailto({$link_id}, {$link_shakebox_index}, '{$instpath}', 1);" class="log2">
</fieldset>
</form>
4. Open templates/yourtemplate/link_summary.tpl and add the following code on Line 2:
Code:
{if $pagename eq "story" && $link_field9 neq 0}
<br /><a style="padding:5px;border:1px solid #FF0000;font-size:18px;color:#FF0000;"><img STYLE="position:relative; TOP:8px;" src="/templates/digitalnature/images/cross.png"> Game was reported as possible spam, a duplicate, or inaccurate!</a><br /><br />
{/if}
On Line 92, before {if $isadmin eq "yes" .... put the following:
Code:
<span id="spam"> | <a style="color:#d01c23" href="javascript://" onclick="show_hide_user_links(document.getElementById('spam-{$link_shakebox_index}'));">Spam!</a>
</span>
Code:
{if $user_logged_in neq ""}
<span id="spam-{$link_shakebox_index}" style="display:none;">
» <a href="javascript://" onclick="show_recommend({$link_id}, {$link_id}, '{$instpath}');">Report Spam</a>
</span>
{else}
<span id="spam-{$link_shakebox_index}" style="display:none;">
» You must be logged in.
</span>
{/if}
then goto Line 193, where it says {if $Enable_Recommend eq 1} and remove everything from that line to the line before {if $story_status ne 'di...., so you should now have at Line 193:
Code:
{if $Enable_AddTo eq 1}
| <a href="javascript://" onclick="var replydisplay=document.getElementById('addto-{$link_id}').style.display ? '' : 'none';document.getElementById('addto-{$link_id}').style.display = replydisplay;">{#PLIGG_Visual_LS_AddThisLinkTo#}</a>
{/if}
{if $story_status ne 'discard' && $link_shakebox_currentuser_votes eq 0 && $link_shakebox_currentuser_reports eq 0}
{if ....
Code:
{if $link_field9 neq 0 && $pagename neq "story"}<b>[Reported as possible Spam/Duplicate/Inaccurate]</b>{/if}
You don't need to worry about enabling link_field9 in extra_fields.php, so that should be it! A couple of notes:
- The format of the email can be changed in recommend.php to your liking.
- If something is reported falsely as spam, be sure to edit the value of link_field9 back to 0 in "pligg_links" or maybe -1000 if people are insisting that it is spam.
- This works on Pligg Beta 9 with the DigitalNature template. I am not sure how well it will work on other versions and other templates, but I would imagine it should not be too much of a problem, it can't hurt to try it out, just backup your files first and post here to let me know what works/doesn't!
I will include the three files that I have edited below: "recommend.php" and "recommend_small.tpl" should be exactly as edited above, so feel free to use those two files, but only use "link_summary.tpl" for REFERENCE because I have made many other changes to it that you may not want. Simply make changes to YOUR link_summary.tpl file in step 4 of my process. Be sure to MAKE BACKUPS of these 3 files before you do this and I hope you enjoy it! Please leave any comments or feedback as it is possible that I have left something out since it is a lot of changes and I may have missed one. Enjoy!







Linear Mode




