i'm gonna show u how to make a Broken Link button on ur site
Note this only works for Member and checked group ( only thy can send a message
(mostly used in file catolog and publishers...)
alway's in page with entry and his full text and comments
First the screenshot:
Now i'm gonna give u the whole code directly and then i'm gonna explain what to change and how
This is the code u need :
Code
<?if($GROUP_ID$!='1' or $GROUP_ID$!='2' )?><script type="text/javascript">complaint=function(){$.post('/index', {s: 'Animorph', subject: 'complaint of a broken link — $ENTRY_TITLE$', message: 'You [b]$USER$ said [url=$ENTRY_URL$]download with a broken link, please take action.', a: '18'};); _uWnd.alert('Sending Message…','',{w:200,h:80,tm:1000};)}</script><style type="text/css">.complaint {border: 1px solid black; background-color: #FFFFFF;} .complaint:hover {background-color: #CCCCCC;}</style><input type="button" value="Report broken link" onclick="complaint()" class="complaint" /><?endif?>
now how to change the USER wheere the PM will be sended to
example , if u have the code on ur website but u changed from account for any reason and u still want to recieve the message u just need to find this name Animorph
and Replace it with Your Name
then the code woul look like this
Code
<?if($GROUP_ID$!='1' or $GROUP_ID$!='2' )?><script type="text/javascript">complaint=function(){$.post('/index', {s: 'YOUR NAME', subject: 'complaint of a broken link — $ENTRY_TITLE$', message: 'You $USER$ said download with a broken link, please take action.', a: '18'};); _uWnd.alert('Sending Message…','',{w:200,h:80,tm:1000};)}</script><style type="text/css">.complaint {border: 1px solid black; background-color: #FFFFFF;} .complaint:hover {background-color: #CCCCCC;}</style><input type="button" value="Report broken link" onclick="complaint()" class="complaint" /><?endif?>
basicly u don't need to change much more , u only need to put the code on the place u wan't the button to appear , its just figuring out where it would look better _________________________________________________________________________________________________________________
Report button working for all users including admin
here is the code :
Code
<?if($USER_LOGGED_IN$)?><script type="text/javascript">complaint=function(){$.post('/index', {s: 'Animorph', subject: 'complaint of a broken link — $ENTRY_TITLE$', message: 'You [b]$USER$ said [url=$ENTRY_URL$]download with a broken link, please take action.', a: '18'};); _uWnd.alert('Sending Message…','',{w:200,h:80,tm:1000};)}</script><style type="text/css">.complaint {border: 1px solid black; background-color: #FFFFFF;} .complaint:hover {background-color: #CCCCCC;}</style><input type="button" value="Report broken link" onclick="complaint()" class="complaint" /><?endif?>
Note: u can't send a report broken link to urself
well if u don't understand this please leave a comment Below
This script notificates the Administrot about a broken link, that a user has found. Also when a user clicks on the button "Broken link", then he will se a Ajax-Window. In the Ajax-Window is a question does the user want to notificate the Administrator about the broken link or not. If the user clicks on "Yes", so the admin will get an PM. With a short text. And if the user clicks on "Cancel" in the Ajax-Window, so the window will be closed.
1. Put befor the following code:
Code
<script type="text/javascript"> function ifsend(){ var ajax_data = 'Do you want to notify the administrator, about that the link ist broken?<hr><input type="button" value="Yes" onclick="_uWnd.close(\'wronglink\');dwld_link();"> <input type="button" value="Cancel" onclick="_uWnd.close(\'wronglink\');">'; new _uWnd('wronglink','Confirm that Action',400,310,{shadow:1,autosize:1,modal:1,close:0,icon:'http://forucoz.com/file/s1/dtl.png'},ajax_data);} function dwld_link(){var s,message,hrf; hrf = window.location.href; s= 'Change_me';//Set the name of the User, who should get the notification about the broken link. message = 'Hello, [b]' + s + '[/b]!\nUser [ url=$HOME_PAGE_LINK$index/8-0-$USERNAME$]$USERNAME$[/url] thinks that this [ url=' + hrf + ']link[/url] is broken.'; $.post('/index/', {s: s,subject: 'Broken link',message: message,a: 18}, function(data){var rs = $('cmd[t="eMessage"][p="innerHTML"]',data).text();_uWnd.alert(rs,'Defekter Link',{w:200,h:95,tm:6000});});}</script>
2. Go in the Customize design to the "Page with entry full text and its comments" from the Modul where you want this script! And put the following code, where you want!
Code
<?if($USER_LOGGED_IN$)?><a href="javascript:;" onclick="ifsend();return false;">Broken Link</a><?else?>Please <a href="$HOME_PAGE_LINK$/index/3">register</a> or <a href="$LOGIN_LINK$">authorize</a> to notificate the Admin about the broken link!<?endif?>
Attention! 1. Only user that are Logged in will see the button "Broken Link", and guests will se a short text about that he should be authorized to notificate the Admin about a broken link. 2. The Security code musst be deactivated, or it would be work! 3. Replace in the 1. code this:
Quote
[ url=$HOME_PAGE_LINK$index/8-0-$USERNAME$]
to this:
Quote
[url=$HOME_PAGE_LINK$index/8-0-$USERNAME$]
and
Quote
[ url=' + hrf + ']
to this
Quote
[url=' + hrf + ']
If you have some problems with that script just ask
Message edited by Adi - Sunday, 2012-11-18, 7:42 PM