Please login or register. Welcome to the Studio, guest!


Quick Links:


newBookmarkLockedFalling

Chris

Chris Avatar

******
Head Coder

19,519


June 2005
Place this module in your global footer.

Notes
- A user must visit your forum then close their browser and revisit before the code will work.
- This code uses session cookies and therefore users must close their browser and revisit to have it count as a new visit. (Also the reason for the above.)

If you have any questions, please post in this thread.

<form name="vpslv" action="?action=search#results" method="post" style="display: none">
<input type="hidden" name="submit_val" value="1" />
<input type="hidden" name="filter_member_ids" value="" />
<select name="search_type">
<option value="posts" selected="selected">posts</option>
</select>
<input type="text" name="search_string" value="%%%" size="25" />
<select name="matching">
<option value="any_words" selected="selected">any words</option>
</select>
<select name="search_area">
<option value="all" selected="selected">entire post</option>
</select>
<select name="scope[]">
<option value="all" selected="selected">» Entire Site «</option>
</select>
<input type="text" name="filter_usernames" value="" />
<select name="filter">
<option value="">Select Member(s)</option>
</select>
<select name="date_filter_type">
<option value="within_the_past" selected="selected">within the past</option>
</select>
<input type="text" name="specific_date_month" value="" /><input type="text" name="specific_date_day" value="" /><input type="text" name="specific_date_year" value="" />
<input type="text" name="between_month1" value="" /><input type="text" name="between_day1" value="" /><input type="text" name="between_year1" value="" /><input type="text" name="between_month2" value="" /><input type="text" name="between_day2" value="" /><input type="text" name="between_year2" value="" />
<input type="text" name="within_the_past_time" value="1" />
<select name="within_the_past_type">
<option value="minutes" selected="selected">minute(s)</option>
</select>
<select name="max_results">
<option value="all" selected="selected">no limit</option>
</select>
<select name="results_per_page">
<option value="25" selected="selected">25</option>
</select>
<select name="display_as">
<option value="posts" selected="selected">posts</option>
</select>
<select name="sort_by">
<option value="date" selected="selected">date</option>
</select>
<select name="order">
<option value="desc" selected="selected">descending</option>
</select>
<input type="submit" value="Search" />
</form>

<script type="text/Javascript">
// View Posts Since Last Visit by Chris
// Do not redistribute outside of HyperBoards Support or Studio Zero

var hb_userid = (document.getElementById("personal_bar_table").getElementsByTagName("a")[0].href.match(/member_id=(\d+)/i)?RegExp.$1:0);
if(document.getElementById("toolbar_table") && document.quick_search && !document.quick_search.topic && hb_userid != 0){
if(document.all){
var i = document.createElement("button");
} else {
var i = document.createElement("input");
i.type = "button";
}
i.value = "Posts Since Last Visit";
document.quick_search.appendChild(i);
i.onclick = function(){
var f = document.forms.vpslv;
var x = (new Date()).getTime()-vpslvLastTime;
x = Math.ceil((x/1000)/60); // Milliseconds to seconds to minutes
f.within_the_past_time.value = x;
f.submit();
}


var _vc = {
get: function(n){
if(document.cookie.match(new RegExp("pslv_"+n+"=(.+?)(;|$)", "gi"))){
return RegExp.$1;
}
return 0;
},
set: function(n, v, e){
document.cookie = "pslv_"+n+"="+v+";"+(e?"expires="+(new Date( )).toGMTString().replace(/\d{4}/, "2050"):"");
}
}
var vpslvLastTime = _vc.get("session_visit") || _vc.get("last_visit") || 1;
_vc.set("session_visit", vpslvLastTime);
_vc.set("last_visit", (new Date()).getTime(), true);
}
</script>



Last Edit: Jul 24, 2007 22:14:18 GMT by Chris

newBookmarkLockedFalling