Keresés az erőforrások között
[Requested] Entry reporting script

[Requested] Entry reporting script

If one of your site's entries has some issues, the users can report it to the uploader or to the administrator of the site.
bigblog2015-10-14 12:52:15 628 Forrás: yraaa.ru

Download

There are many entry reporting scripts built for the uCoz system, but none of them were working correctly and none of them were so easy to personalize. Today, we brought you the script, which fulfills both criterias: it's working perfectly and it's pretty easy to personalize.

How to install the script?


1. Download the archive and upload the js folder to your site (we recommend to use FTP).

2. Go to Control Panel » Design customization » Page with full entry text and associated comments (of the required module). Here you have to paste the button or the link wherever you want.

For a button, insert the following code:

Kód
<?if($USER_ID$ != $UID$ && $USER_LOGGED_IN$)?>
<button onclick="startCTM()">Report the entry</button>
<?endif?>

For a normal link, insert the following one:

Kód
<?if($USER_ID$ != $UID$ && $USER_LOGGED_IN$)?>
<a href="javascript://" class="kn_mat" onclick="startCTM()">Report the entry</a>
<?endif?>

We recommend using the second one, since it's easier to customize with some CSS knowledge.

After you did this, insert the following code after the code of the link or button:

Kód
<script type="text/javascript">  
var username = '$USER$';  
var ctmarray = [  
{'ctm':['Incorrect source',true,'Please post the correct source.']},  
{'ctm':['The download link is not working']},  
{'ctm':['Incorrect main picture']},  
{'ctm':['Copyright infringement',true,'$USERNAME$, please show us a proof.']},  
{'ctm':['I have another complaint',true,'$USERNAME$, please tell us what happened.']}  
];  
var ctmtmp = [  
'The following entry was reported: [b][url={URL}]{TITLE}[/url][/b][br]Content of the report: [color=#ff0000][b]{MOAN_MESSAGE}[/b][/color]',  
'[br]Additional information: [color=#38761D][b]{EXTRA_MESSAGE}[/b][/color]'  
];  
/*  
{URL} = The URL address of that entry from where the report came  
{TITLE} = The title of the entry
{MOAN_MESSAGE} = The text of the complaint
{EXTRA_MESSAGE} = Additional informations, if they are present
*/  
</script>  

  <script type="text/javascript" src="/js/entry_report.js"></script>

How to customize the script?


Customizing of the script is very easy. If you want to show more elements (types of reports) for your users, just insert a new line where you want to see the new field. The code lines look as they follow:

All you have to do is to insert these lines wherever you want to see them in the order. It's important to place a comma (,) after each of them, excepting the last element!

By default, the script sends the report to the author of the entry. If you, the owner of the site want to receive the reports, replace the $USER$ variable in the code with your own username.

WARNING!


The script will work only if the Security code is disabled for the users. Otherwise those users, to whom the security code is usually shown will receive an error.

You can modify the user permission in Control Panel » Users » User groups » Set permissions for all groups » Other.

Original: http://ucoztaska.net/szkript....lentese

Hozzászólások (0)

A hozzászólási lehetőség ideiglenesen kikapcsolva