Forum moderator: bigblog |
uCoz Community For Webmasters Custom Solutions Coding Requests (Request/Assist With Custom Codes Here) |
Coding Requests |
Coding Requests In this thread users of the uCoz system are able to request the development of custom scripts for their sites. Requests are carried out voluntarily by other forum users so please understand not all requests may be completed within a short time-frame or even at all. About: Posting Requests If posting a custom scripting requests please include the following;
About: Completing Requests If you have completed a request please use the following template when posting. Code Requested By: $USER$ Requested On: $DATE_REQUESTED$ Solution: $SOLUTION$ Jack of all trades in development, design, strategy.
Working as a Support Engineer. Been here for 13 years and counting. |
We have always used the reputation feature as a 'Thanks Button' @ our site. It works well for us this way.
I would like to add the 'username' of who 'thanked' or added 'reputation' at the bottom of the post. we used a similar feature with IPB some years ago. I searched ucoz and found a referrence that it's possible thru custom scripting. http://forum.ucoz.com/forum/9-2161-104690-16-1385720921 ... can this be accomplished with the current Ucoz system ? Ucoz Website Since 2009
Post edited by Clyde - Saturday, 2014-09-27, 3:55 AM
|
I have a website appsworldandroid.tk
i want to add a search box to it and how to make that search box search content on website. ? i want it to work like the one on this website apkgalaxy.com so that its easy to find games and apps with typed text in search box. |
I need a notification message appear when receiving a new message from other user. (PM system)
Thanks! (+ 10 rep for any one can help) :p Post edited by lanh - Sunday, 2014-12-28, 10:16 AM
|
lanh, insert this to the end of the Bottom part of the website template:
Code <script type="text/javascript">jQuery(document).ready(function(){setInterval("jQuery('#timeA').load('# span#timeB');",3000);});</script> <style type="text/css">.pmnotif {padding:15px;border-radius:8px;font:9pt 'Segoe UI';position:fixed;bottom:20px;right:20px;display:inline-block;background:#222;color:#fff;-webkit-box-shadow:inset 0 0 18px 0 #111;box-shadow:inset 0 0 18px 0 #111;color:#fff;text-shadow: 1px 0 10px #eee;width:250px;} .pmnotif b {margin-bottom:14px;display:block;}</style> <span id="timeA"><span id="timeB"> <?if($UNREAD_PM$)?><a href="/index/14"><div class="pmnotif"><b>You have $UNREAD_PM$ unread PM<?if($UNREAD_PM$>1)?>s<?endif?>.</b> Click here to read the messages.</div></a><?endif?> </span></span> hey i'm joe and i do not work for the company anymore, please contact other staff or tech support
icon by ch-chau sometimes i lurk here |
bigblog, What is the difference between your and this code? I mean if is bether than this wich i use i will be glad to use it
Code <a id="upml" class="knopka_pochta" href="javascript:openLayerA('privatneporuke','/index/14','Poruke','700','450','yes')">Inbox ($UNREAD_PM$)</a> <?if($IS_NEW_PM$)?><script type="text/javascript">function flashit(id,cl){var c=document.getElementById(id);if (c.style.color=='red'){c.style.color=cl;}else {c.style.color='red';}}setInterval("flashit('upml','')",500)</script><bgsound src="http://s26.ucoz.net/img/fr/pm.wav" loop="1" volume="0" balance="0"> <?endif?> The problem is just in fact that this script wont work whitout js file Code // Powered by botanic. Helper-Ucoz-Ru 4 ever!!!! var _umlparents=[]; //hash of mover _umlparents var _umlcoords=[]; //hash of last layer _umlcoords for IE var _resID=''; var _umlhave=''; var _umloffX,_umloffY,_umlscrX,_umlscrY; var _uml_ie=0; var _umlunable=0; var _zindex=10000; var _dontOnTop=0; var _mwdH=400; var _useShadow=0; var f=0 function openLayerA(n,u,t,w,h,is,resize,anyVar2,grid,multypart,align){ if (!align){align='center';} if (resize){_resID=n;}else{_resID='';} h-=30; _zindex++; var scrw=document.body.clientWidth>0 ? document.body.clientWidth : window.innerWidth>0 ? window.innerWidth : document.body.offsetWidth; var scrh=document.body.clientHeight>0 ? document.body.clientHeight : window.innerHeight>0 ? window.innerHeight : document.body.offsetHeight; if (scrh<450){_mwdH=scrh-50;}else{_mwdH=100;} var x = (scrw-w)/2; var y = (scrh-h)/2-20; if (!document.getElementById('newLayer'+n)){ var o=document.createElement('div'); o.id='newLayer'+n; document.body.appendChild(o); var os=document.createElement('div'); os.id='newLayerSh'+n; document.body.appendChild(os); } if (grid){ var og; if (!document.getElementById('newLayerGrid')){ og=document.createElement('div'); og.id='newLayerGrid'; document.body.appendChild(og); og.className='myWinGrid'; } else {og=document.getElementById('newLayerGrid');} og.style.zIndex=_zindex; og.style.width=document.body.scrollWidth+'px'; og.style.height=document.body.scrollHeight+'px'; if (_uml_ie){ og.style.left=document.body.scrollLeft; og.style.top=document.body.scrollTop; } else {og.style.position='fixed';} og.style.display=''; } document.getElementById('newLayer'+n).innerHTML='' + '<div class="xw xw-plain" onclick="if(!_dontOnTop){_showOnTop(\''+n+'\')}else{_dontOnTop=0;}" id="outLayer'+n+'" style="position:absolute;z-index:'+(_zindex+2)+';top:'+y+'px;left:'+x+'px;width:'+w+'px;">' + '<div class="xw-tl" unselectable="on">' + '<div class="xw-tr">' + '<div class="xw-tc" align="left">' + '<div id="myWhead'+n+'" unselectable="on" onmouseup="_create_shadow(\''+n+'\');" class="xw-hdr x-unselectable xp-icon xw-draggable">' + '<div id="myWclose'+n+'" class="xt xt-close" onclick="_closeMyWin(\''+n+'\')"; onmouseover="this.className=\'xt xt-close xt-close-over\'" onmouseout="this.className=\'xt xt-close\'"></div>' + '<span unselectable="on" class="xw-hdr-text" id="layerTitle'+n+'">'+t+'</span></div>' + '</div></div></div>' + '<div class="xw-bwrap">' + '<div class="xw-ml">' + '<div class="xw-mr">' + '<div class="xw-mc" id="xw-mc'+n+'">' + '<div id="myWinBody'+n+'" class="xw-body" style="overflow:auto;height:'+h+'px;">' + '<div class="myWinCont" id="myWinCont'+n+'" style="width*:100%;"><div align="'+align+'" id="layerContent'+n+'"><iframe src="'+u+'" marginwidth="1" marginheight="1" height="100%" width="100%" scrolling="'+is+'" border="0" frameborder="0"></iframe></div></div>' + '</div></div></div></div></div>' + '<div class="xw-bl"><div class="xw-br">' + '<div class="xw-bc"><div class="xw-footer"></div>' + '</div></div></div></div>'; document.getElementById('newLayer'+n).style.display=''; _umlRegMover('myWhead'+n,'outLayer'+n); if (!resize){ _create_shadow(n); } } function _showOnTop(n,f){ if (f){ if (parseInt(document.getElementById(n).style.zIndex)<(_zindex)){ document.getElementById(n).style.zIndex=_zindex+3; _zindex+=3; } } else { if (parseInt(document.getElementById('outLayer'+n).style.zIndex)<(_zindex+2)){ document.getElementById('outLayer'+n).style.zIndex=_zindex+3 ; try {document.getElementById('myWxs'+n).style.zIndex=_zindex+2;}catch(e){}; _zindex+=1; } } } function _create_shadow(n){if (!_useShadow){return;} document.getElementById('newLayerSh'+n).style.display='none'; var mww=document.getElementById('outLayer'+n).offsetWidth; var mwh=document.getElementById('outLayer'+n).offsetHeight; var mzi=document.getElementById('outLayer'+n).style.zIndex; document.getElementById('newLayerSh'+n).innerHTML = '' + '<div id="myWxs'+n+'" class="x-sh" style="z-index:'+(mzi-1)+';width:'+(mww+10)+'px;height:'+(mwh+10)+'px;display:block;">' + '<div class="xst">' + '<div class="xstl"> </div>' + '<div class="xstc" style="width:'+(mww-8)+'px;"></div>' + '<div class="xstr"></div></div>' + '<div id="xsc'+n+'" style="height:'+(mwh-8)+'px;">' + '<div class="xsml"></div>' + '<div class="xsmc" style="width:'+(mww-8)+'px;"></div>' + '<div class="xsmr"></div></div>' + '<div class="xsb"><div class="xsbl"></div>' + '<div class="xsbc" style="width:'+(mww-8)+'px;"></div>' + '<div class="xsbr"></div></div></div>'; _shcoords('outLayer'+n); document.getElementById('newLayerSh'+n).style.display=''; } function _shcoords(id){if (!_useShadow){return;} if (!id){return;} var n = id.substr(8); if (!document.getElementById('myWxs'+n)){return;} var _shadw = document.getElementById('myWxs'+n); var pos=_umlGetCoord(document.getElementById('outLayer'+n)); if(!_uml_ie) { _shadw.style.position='fixed'; _shadw.style.overflow='auto'; _shadw.style.left=(pos['left'])+'px'; _shadw.style.top=(pos['top'])+'px'; } else { _shadw.style.left=(pos['left']-3)+'px'; _shadw.style.top=(pos['top']-3)+'px'; _shadw.style.filter = 'progid:DXImageTransform.Microsoft.alpha(opacity=50) progid:DXImageTransform.Microsoft.Blur(pixelradius=3);'; } } function _closeMyWin(n){ document.getElementById('layerContent'+n).innerHTML=''; document.getElementById('newLayer'+n).style.display='none'; try{document.getElementById('newLayerSh'+n).style.display='none';}catch(e){} try{document.getElementById('newLayerGrid').style.display='none'}catch(e){} } var _cur_size8,_tar_size8,_dk_step8; function _chLctSize(w1){ if (!document.getElementById('myWinBody'+w1) || !document.getElementById('layerContent'+w1)){return;} var step=10; var incr=_uml_ie?4:4; _cur_size8 = parseInt(document.getElementById('myWinBody'+w1).style.height); _tar_size8 = document.getElementById('myWinCont'+w1).offsetHeight+incr; if (_tar_size8<40){_tar_size8=40;}else if (_tar_size8>_mwdH){_tar_size8=_mwdH;} if (_cur_size8>_tar_size8){_dk_step8=-step;if(_cur_size8-_tar_size8<step){_dk_step8=-(_cur_size8-_tar_size8);}} else{_dk_step8=step;if(_tar_size8-_cur_size8<_dk_step8){_dk_step8=_tar_size8-_cur_size8;}} setTimeout('_chLctSizeTimer("'+w1+'")',10); } function _chLctSizeTimer(w1){ if ((_dk_step8>0 && _cur_size8<=_tar_size8-_dk_step8) || (_dk_step8<0 && _cur_size8>=_tar_size8-_dk_step8)){ document.getElementById('newLayerSh'+w1).style.display='none'; if (_dk_step8>0&&(_tar_size8-_cur_size8-_dk_step8<_dk_step8)){_dk_step8=_tar_size8-_cur_size8;} else if (_dk_step8<0&&(_tar_size8-_cur_size8-_dk_step8>_dk_step8)){_dk_step8=_tar_size8-_cur_size8;} _cur_size8+=_dk_step8; var newtop = parseInt(document.getElementById('outLayer'+w1).style.top)-parseInt(_dk_step8/2); if ((_uml_ie && newtop>=document.body.scrollTop) || (!_uml_ie && newtop>=0)){document.getElementById('outLayer'+w1).style.top=newtop;} document.getElementById('myWinBody'+w1).style.height=_cur_size8+'px'; setTimeout('_chLctSizeTimer("'+w1+'")',10); } else { _resID=''; document.getElementById('myWinCont'+w1).style.visibility='visible'; _create_shadow(w1); } } if (document.addEventListener){ document.addEventListener('mouseup',_umlUp,false); document.addEventListener('mousemove',_umlMove,false); } else if (window.attachEvent){ document.attachEvent('onmouseup', _umlUp); document.attachEvent('onmousemove', _umlMove); window.attachEvent('onscroll', _umlScroll); _uml_ie=1; } else { _umlunable=1; } var _entrRm={}; function _entrRem(bID,u,imgurl,text){ if (!text){text='Are you sure?';} if (!_entrRm[bID] && confirm(text)){_entrRm[bID]=1; document.getElementById(bID).src=imgurl+'/img/fr/EmnAjax.gif'; var cObj = uz.util.Connect.asyncRequest('GET',u,callback); } } function _umlGetCoord(obj){ if(!obj) return { 'left' : 0, 'top' : 0 }; var left_offset = obj.offsetLeft; var top_offset = obj.offsetTop; if(!left_offset && !top_offset && obj.offsetParent==null) { left_offset=parseInt(obj.style.left); top_offset=parseInt(obj.style.top); } else while ((obj = obj.offsetParent) != null) { left_offset += obj.offsetLeft; top_offset += obj.offsetTop; } return { 'left' : left_offset, 'top' : top_offset }; } function _umlRegMover(mover,movparent) { if(_umlunable) return; var it=document.getElementById(mover); var itpar=document.getElementById(movparent); if(!it || !itpar) return; if(!_uml_ie && itpar.style.position!='fixed') {itpar.style.position='fixed';} _umlparents[mover]=itpar; if(_uml_ie) { _umlscrX=document.body.scrollLeft; _umlscrY=document.body.scrollTop; var pos=_umlGetCoord(itpar); _umlcoords[mover]=[pos['left']+_umlscrX,pos['top']+_umlscrY]; itpar.style.left=_umlcoords[mover][0]+'px'; itpar.style.top=_umlcoords[mover][1]+'px'; it.attachEvent('onmousedown',_umlDown); } else it.addEventListener('mousedown',_umlDown,false); it.style.cursor="move"; } function _umlMove(e) { if(_uml_ie) e=event; if(!_umlhave) return; var n = _umlparents[_umlhave.id].id.substr(8); document.getElementById('newLayerSh'+n).style.display='none'; if(_uml_ie && (e.button&1)==0) {_umlUp(e);return;} _umlparents[_umlhave.id].style.left=(_umloffX+e.clientX)+'px'; _umlparents[_umlhave.id].style.top=(_umloffY+e.clientY)+'px'; if(window.getSelection){ window.getSelection().removeAllRanges(); } else if(document.selection) { if(document.selection.type!='none') document.selection.empty(); } } function _umlScroll(e) { if(_uml_ie) e=event; for(var i in _umlcoords) { var newx=_umlcoords[i][0]+document.body.scrollLeft-_umlscrX; if(newx+_umlparents[i].offsetWidth<document.body.scrollWidth) _umlparents[i].style.left=newx+'px'; var newy=_umlcoords[i][1]+document.body.scrollTop-_umlscrY; if(newy+_umlparents[i].offsetHeight<document.body.scrollHeight) _umlparents[i].style.top=newy+'px'; if (_useShadow){_shcoords(_umlparents[i].id);} } } function _umlDown(e) { if(_uml_ie) { if(!_umlparents[event.srcElement.id]) return; e=event; if(e.button && (e.button&1)!=1) return; _umlhave=e.srcElement; } else { _umlhave=this; e.stopPropagation(); } var pos=_umlGetCoord(_umlparents[_umlhave.id]); _umloffX=pos['left']-e.clientX; _umloffY=pos['top']-e.clientY; if(_uml_ie){ _umlscrX=document.body.scrollLeft; _umlscrY=document.body.scrollTop; var pos=_umlGetCoord(_umlparents[_umlhave.id]); _umlcoords[_umlhave.id]=[pos['left'],pos['top']]; } } function _umlUp(e) { if(!_umlhave) return; if(_uml_ie){ var pos=_umlGetCoord(_umlparents[_umlhave.id]); _umlcoords[_umlhave.id]=[pos['left'],pos['top']]; } _umlhave=0; } !
Post edited by Ed05 - Sunday, 2014-12-28, 11:42 AM
|
Ed05, your code returns a uCoz Window and a background sound in each 0,5 seconds if you have one or more unread PMs. My code returns a little "block" in each 3 seconds if you have 1 or more unread PMs. Both codes are totally customizable, but the advantage of my code is that it's pretty simple. I used 3 seconds due to security reasons. Too much requests can block your IP on the site.
hey i'm joe and i do not work for the company anymore, please contact other staff or tech support
icon by ch-chau sometimes i lurk here |
Ps, if anyone needs button
Quote add to favorites So, put in apearance for enteries of site news module Code <div class="friends44"> <table> <tr> <td><?if($OTHER3$)?> <img src="$OTHER3$" width="200px" height="150"> <?else?> <img src="/new_shab/images/miniphoto.png" width="100px"> <?endif?></td> <td>Naslov: <a href="$OTHER2$" title="">$TITLE$</a><br>ID: $OTHER4$<br><small> </small>$MODER_PANEL$ ukloni</td> <tr> </table> <div style="border-top:1px solid #2c5687; border-bottom:1px solid #2c5687;">$CAT_NAME$</div> </div> And on page with full entry text and comments of module that you need to use this code. I use load module. Code <span style="display:none;" class="avaddd"><img src="$IMG_URL1$" border="0" max-width="60px" width="60px"></span> <script type="text/javascript"> function addeeefriends(){ new _uWnd("addfriends1","Dodavanje u favorite",250,100,{modal:1,align:0,autosize:1},$("#addeeefriends").html()); } </script> <div style="display:none" id="addeeefriends"> <table> <tr> <td><img width="50" src="$IMG_URL1$" border="0" max-width="60px" width="60px"></td> <td style="padding-left:5px;">Zelite da dodate <b>$ENTRY_TITLE$</b> u favorite?</br>After you confirm the entry will automatically find your list of favorites.</td> </tr> </table> <div style="float:right;"> <input type="submit" value="Add" "javascript://" onclick="Addfriends();_uWnd.close('addfriends1');" title="Add"> <input type="submit" value="Cancel" "javascript://" onclick="_uWnd.close('addfriends1');" title="Cancel"> </div> </div> <script type="text/javascript"> $.get('/news/0-0-0-0-17-$_USER_ID$ ',function(uwnd56456){ var result3 = $('#dfgdddfg',uwnd56456).html(); if(result3.indexOf('$ENTRY_URL$')=='-1') { $('#mmmmmmd').html('<a class="Smenu_link" href="javascript:addeeefriends()"><img src="Your website link/add-to-favorites-icon.png" alt="Smiley face" align="absmiddle">Save</a>') } else { $('#mmmmmmd').html('<a class="Smenu_link">Saved</a>') }; }); </script><div class="BlockTitlle" style="height:14px;"><!-- <bt> --><!--<s5184>--> </div> <div class="BlockCont" style="padding:0px;"> <!-- <bc> --> <script type="text/javascript"> function infols() { $.get('/index/14-0-0-1', function (data) { ssid = $('input[name="ssid"]', data).val(); if ($("#secuImg", data).size() > 0) { imgsec = $("#secuImg", data).clone(); seckey = $("input[name='seckey']", data).val(); new _uWnd('cap', 'Code from the picture', 300, 80, { autosize: 0, modal: 1, oncontent: function () { $("#capImgSpan").html(imgsec); $("#capcode").focus(); } }, '<span id="capImgSpan"></span> <input type="text" id="capcode" onkeyup="name33()" maxlength="5">'); } else { $.post('/blog', { a: '18', s: '$ENTRY_TITLE$', subject: 'notice', message: 'I have successfully added you as a friend', ssid: ssid }, function (e) {if($(e).text().indexOf('succes')>-1) {_uWnd.alert("User successfully added to Friend","success",{w: 270,h: 100,t: 8000});}}); } }); } function name33() { code = $("#capcode").val(); if (code.length == 5) { $.post("/blog", { a: '18', s: '$ENTRY_TITLE$', subject: 'notice', message: 'I have successfully added you as a friend', ssid: ssid, code: code, seckey: seckey }, function (re) { rTxt = $($(re).text()).text(); if(rTxt.indexOf("succ") > -1) { setTimeout('_uWnd.close("pmsend")', 500); _uWnd.close('cap'); _uWnd.alert('message sent', 'success', { w: 225, h: 75 }); } else { if(rTxt.indexOf("код б") > -1) { $('#secuImg').click(); } else { _uWnd.close('cap'); _uWnd.alert(rTxt, 'attention', { w: 225, h: 75 }); } } }); $("#ucodespostmessagepm").attr({disabled: 0, value: "Send Message"}); $("#st").empty(); $("#ucodesmessagepm").empty(); } } </script> <script> function Addfriends() { $.get('/news/0-0-0-0-1', function(data){ var ssid = $('input[name="ssid"]', data).val(); $.post('/news/', { a: 2, jkd428: 1, jkd498: 1, ocat: 1, title: '$ENTRY_TITLE$', other1: '$IMG_URL1$', other2: '$ENTRY_URL$', other3: '$IMG_URL1$', other4: $ID$, ssid: ssid }, function(qwe){ var er = $(qwe).text(); if(er.indexOf('successfully')>-1){infols();} else {_uWnd.alert('<font color="red">Error, you must be logged in!</font>','',{w: 270,h: 100,t: 8000});}; }); }); }; function addfrinfo(){ _uWnd.alert("Uklonjen iz favorita!<br>2 seconds, the update.","successfully",{w: 270,h: 100,t: 8000}); setTimeout("document.location.reload()",2000); }; </script> Where you want to button add to fav apear paste this Code <span id="mmmmmmd"></span> Dont forget to enable reqested custom fields in site news module. Im not the author of the script but i do eddited it for my needs cause it did not worked for what i expect to work. After eddit it works.This code was originally intended for add friends feature . !
Post edited by Ed05 - Sunday, 2014-12-28, 11:58 AM
|
bigblog, widget, where?
Added (2014-12-28, 12:02 PM) --------------------------------------------- your code returns a uCoz Window and a background sound in each 0,5 seconds if you have one or more unread PMs. I dont have that problem and i had over 100 messages. And im not the only one who use that code, extracafe.rs use it very long time.The only problem wich i haved is with <!DOCTYPE> validation. But i resloved that !
Post edited by Ed05 - Sunday, 2014-12-28, 12:02 PM
|
It was not my need. I need something like facebook :v when you receive a message or anything, a small window appear right away. Anyway, thank you! |
lanh, you can put PMs in a frame, but it isn't a very nice way for this.
Ed05, search between the widgets: http://screencast.com/t/tYYAvKGYF7 hey i'm joe and i do not work for the company anymore, please contact other staff or tech support
icon by ch-chau sometimes i lurk here |
Quote It was not my need. I need something like facebook :v when you receive a message or anything, a small window appear right away. lanh, you can do that with javascript. Post edited by Mar1aN - Sunday, 2014-12-28, 2:29 PM
|
bigblog, for me that widget never worked. I mean the problem is probably in fact that this widget dont recognize $ENTRY_URL$ code wich is inevitably field in this case in order to save diferent enteries.
!
Post edited by Ed05 - Sunday, 2014-12-28, 10:49 PM
|
Hi Mar1aN,
I have no knowledge at java script Thanks ==================== Hi All, Is there anyway to output the reputation message in the template rather than click on reputation link? Thanks! Post edited by lanh - Monday, 2014-12-29, 2:01 PM
|
| |||