• Page 1 of 2
  • 1
  • 2
  • »
Forum moderator: bigblog  
uCoz Community » For Webmasters » Custom Solutions » Notification about a broken link (Ajax) (Tutorial)
Notification about a broken link (Ajax)
Cheburator
Posts: 13
Reputation: 8

Message # 1 | 11:42 PM
Notification about a broken link in an Ajax-Window

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 smile

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:

Code
[ url=$HOME_PAGE_LINK$index/8-0-$USERNAME$]

to this:
Code
[url=$HOME_PAGE_LINK$index/8-0-$USERNAME$]

and

Code
[ url=' + hrf + ']

to this
Code
[url=' + hrf + ']

If you have some problems with that script just ask smile

Edited by Dartz
Source: -Removed-
Author: -Removed-

- Don't lie!


"What's the difference between a wife and a job? After 10 years a job still sucks."
Post edited by Cheburator - Saturday, 2010-02-27, 1:00 PM
Kurt
 
Posts: 25
Reputation: 7

Message # 2 | 9:10 AM
Cheburator, Nice! It would be excellent if the screenshots would be in English.
Cheburator
Posts: 13
Reputation: 8

Message # 3 | 12:47 PM
Kurt, thanks =) here are the Screenshots in English.

http://img94.imageshack.us/img94/3048/61942454.png
http://img28.imageshack.us/img28/6357/29434614.png
http://img19.imageshack.us/img19/7673/77415973.png
http://img709.imageshack.us/img709/8771/16693096.png


"What's the difference between a wife and a job? After 10 years a job still sucks."
Dartz
Posts: 1931

Message # 4 | 12:56 PM
Cheburator, replace them.
[... With uCoz since December 2 2007 ...]
Cheburator
Posts: 13
Reputation: 8

Message # 5 | 1:01 PM
Dartz, done!
"What's the difference between a wife and a job? After 10 years a job still sucks."
NTP
Posts: 296
Reputation: 10

Message # 6 | 10:26 PM
Cheburator, this is useful, especially in the case as modifying the code to be able to report users, rep +1! happy
Web design and film == my 2 passions.

Genesis Inc. ~ New Horizons, New Beginnings
CoffeeCone
Posts: 687
Reputation: 41

Message # 7 | 8:38 PM
Quote (Cheburator)
Attention!
2. The Security code musst be deactivated, or it would be work!

How do you deactivate the security code? It keeps giving me the alert below

PS.
Check out the screenshot of my control panel below

Attachments: 3819820.png (17.1 Kb) · 5816278.png (2.0 Kb)

"Friends don't let friends use Internet Explorer 6." - Microsoft || Join the cause. Help your friends.


Post edited by shadowslash - Saturday, 2010-05-08, 9:23 PM
NTP
Posts: 296
Reputation: 10

Message # 8 | 3:54 AM
Go to User Permissions http://forum.ucoz.com/forum/7-5305-1
Web design and film == my 2 passions.

Genesis Inc. ~ New Horizons, New Beginnings
CoffeeCone
Posts: 687
Reputation: 41

Message # 9 | 7:03 AM
Quote (NTP)
Go to User Permissions http://forum.ucoz.com/forum/7-5305-1

I already did that as indicated on my previous post...

I already set this option but the Security Code is still present. sad
Attachments: 0561271.png (17.1 Kb)

"Friends don't let friends use Internet Explorer 6." - Microsoft || Join the cause. Help your friends.


Scubs
Posts: 18
Reputation: 2

Message # 10 | 5:12 PM
Quote (Cheburator)
<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, ' + s + '!\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>

where does this code goes , Dartz can u help me here ,

Quote (Cheburator)
1. Put befor the following code:

what does he mean with that

Dartz
Posts: 1931

Message # 11 | 7:03 PM
I can't assist. I do not work with other people codes cuz they are either
stolen or messed badly. Thread creator should provide support not me.

[... With uCoz since December 2 2007 ...]
Scubs
Posts: 18
Reputation: 2

Message # 12 | 8:48 PM
Quote (Dartz)
I can't assist. I do not work with other people codes cuz they are either
stolen or messed badly. Thread creator should provide support not me

okay well thanks for the reply anyway

i will try to contact him tommorow

ZTSF
Posts: 24
Reputation: 1

Message # 13 | 9:48 PM
If i try this script, and i click at yes, i get: Access denied. Session period expired.
How can i fix this??

ZTSF wink


Come to ZTSF: www.superzt.ucoz.com
Post edited by ZTSF - Thursday, 2011-03-10, 9:49 PM
Animorph
Posts: 2856
Reputation: 189

Message # 14 | 0:18 AM
ZTSF, this script is old i know somebody who has a working one and i will contact you in PM about it or you can talk in our native language in here:
http://forum.ucoz.com/forum/28-10160-1

To busy building a passive income online ;)
AlexMalik
Posts: 30
Reputation: 0

Message # 15 | 4:22 PM
Cheburator,

THis message is coming after i click on "Yes" :/
-HELP!

===[On Social Network]===
Facebook/-/Twitter
===[My Website]===
WainsOrg
uCoz Community » For Webmasters » Custom Solutions » Notification about a broken link (Ajax) (Tutorial)
  • Page 1 of 2
  • 1
  • 2
  • »
Search: