|
PLEASE DELETE ----- PLEASE DELETE; PLEASE DELETE ----- PLEASE DELETE
|
|
Topic Started: Jan 19 2010, 07:36 PM (379 Views)
|
|
Volksdevil-ZNR
|
Jan 19 2010, 07:36 PM
Post #1
|
- Posts:
- 12
- Group:
- Members
- Member
- #383,278
- Joined:
- January 18, 2010
|
Board Address: Forum.Volksdevil.com Type of Request: A script for an active topics in the last x? days script.)
Description:
Well the 'Active Topics' form hasn't worked since 2005 when i set up my forum, i've asked and asked about it but nothing ever comes of it. I think it's a major element that would massively help keep more forums active and busy. This is the form i mean (1st Below)...Surely it just needs a tweak somewhere? It has been 5 years since it worked, or more after all!
But what id be really happy with would be a little more simple...Forgetting the 'To' part of the form and just having the 'Show active topics since x days' part. Im hoping something can be put together as im Sure! it would be of great use to a lot of invisionfree users
Maybe the replacement search code could somehow be simplified to create an active topics form??? (see 2nd code below)
- Code:
-
<form action='http://forum.volksdevil.com/index.php?act=Search&CODE=getactive' method='post' name='dateline' onsubmit='return checkvalues();'> <div class="pagelinks"></div> <div align="right" style="width:35%;text-align:center;margin-right:0;margin-left:auto"> <fieldset class="search"> <legend><strong>Show me active topics posted...</strong></legend> <label for='st_day'>From</label> <select name='st_day' id='st_day' class='forminput'> <option value='s1'>Yesterday</option> <option value='s2'>2 days ago</option> <option value='s3'>3 days ago</option> <option value='s4'>4 days ago</option> <option value='s5'>5 days ago</option> <option value='s6'>6 days ago</option> <option value='s7'>Last Week</option> <option value='s30'>Last Month</option> </select> <label for='end_day'>To</label> <select name='end_day' id='end_day' class='forminput'> <option value='e0'>Today</option> <option value='e1'>Yesterday</option> <option value='e2'>2 days ago</option> <option value='e3'>3 days ago</option> <option value='e4'>4 days ago</option> <option value='e5'>5 days ago</option> <option value='e6'>6 days ago</option> <option value='e7'>Last Week</option> </select> <input type='submit' value='>>' title="Submit form and get the requested active topics" class='forminput'> </fieldset> </div> </form>
- Code:
-
var searchlimit = 10;
function newCookie(name, value) { document.cookie = name + '=' + value + '; expires=Sun, 19 Sep 9999 6:10:10 UTC; path=/'; }
function killCookie(kill) { document.cookie = name + '=; expires=Sun, 19 Sep 0000 6:10:10 UTC; path=/'; }
function newCookie2(namevalue, expires) { document.cookie = namevalue + '; expires=' + new Date(Math.floor(new Date().getTime()) + Math.floor(expires)).toGMTString() + '; path=/'; }
if(document.cookie.match('day=over')) {} else { newCookie('searchamount', '0'); newCookie2('day=over', 86400000); }
var searchamount = document.cookie.split('searchamount=')[1]; if(searchamount == null) { newCookie('searchamount', '0'); var searchamount = document.cookie.split('searchamount=')[1]; } searchamount = searchamount.split(';')[0];
var searchlimitend = 'es'; if(searchamount == Math.floor(searchlimit) - 1) { var searchlimitend = ''; }
var srt = '<div class="maintitle" align="center">Search Results</div><table id="searchresults" width="100%" valign="top" cellSpacing="1" cellPadding="6"><tr><td align="center" class="titlemedium"><img src="http://i6.ifrm.com/style_images/1/spacer.gif" alt="" width="20" height="1" /></td><td align="center" class="titlemedium"><img src="http://i6.ifrm.com/style_images/1/spacer.gif" alt="" width="20" height="1" /></td><th width="45%" align="left" nowrap="nowrap" class="titlemedium">Topic Title</th><th width="14%" align="center" nowrap="nowrap" class="titlemedium">Topic Starter</th><th width="7%" align="center" nowrap="nowrap" class="titlemedium">Replies</th><th width="7%" align="center" nowrap="nowrap" class="titlemedium">Views</th><th width="27%" align="left" nowrap="nowrap" class="titlemedium">Last Action</th></tr></table>'; var linkurl = window.location.href.split('index.php')[0]; if(document.title == 'Search Engine') { var x = document.getElementsByTagName('DIV'); for(i=0;i<x.length;i++) { if(x[i].className == 'tableborder') { x[i].id = 'searchf'; }} var searchf = document.getElementById('searchf'); if(searchf != null) { searchf.className = null; searchf.innerHTML = '<div class="tableborder" style="display:none;">' + srt + '</div><div id="searchframes"></div><br /><br /><div class="tableborder"><div class="maintitle" align="center">Search Keywords</div><table width="100%" valign="top" cellPadding="6" cellSpacing="0"><tr><td class="pformstrip" width="50%" align="left" valign="top">Search by Keywords</td><td width="50%" align="left" class="pformstrip" valign="top">Filter by Member Name (optional)</td></tr><tr><td class="row2" valign="top"><input type="text" class="forminput" size="40" value="" id="searchkeywords" id="searchkeywords" /><br /><br />Enter a keyword or phrase to search by.</td><td class="row2" valign="top"><input type="text" class="forminput" size="40" value="" id="searchmembername" id="searchmembername" /><br /><br /><input type="checkbox" class="checkbox" id="matchname" name="matchname" /> <label for="matchname">Match Exact Name</label></td></tr></table><div class="pformstrip" align="center">You have ' + (Math.floor(searchlimit) - Math.floor(searchamount)) + ' search' + searchlimitend + ' left.</div></div>'; if(searchamount != searchlimit) { searchf.innerHTML += '<div id="searchdiv" style="display:none;"><br /><br /><div class="tableborder"><div class="maintitle" align="center">Search Options</div><table width="100%" valign="top" cellPadding="6" cellSpacing="0"><tr><td class="pformstrip" width="50%" align="left" valign="top">Search Where</td><td width="50%" align="left" class="pformstrip" valign="top">Refine Search</td></tr><tr><td class="row2" valign="top" style="padding:12px;"><select multiple="multiple" class="forminput" id="searchforums" name="searchforums" size="10"><option selected="selected">All Forums</option></select></td><td class="row2" valign="top" style="padding:12px;"><table width="100%" cellPadding="0" cellSpacing="6" valign="top"><tr><td width="50%" valign="top"><fieldset><legend><b>Search posts from...</b></legend><div style="padding:6px;"><select id="searchfrom" class="forminput"><option>Today</option><option>7 days ago and newer</option><option>30 days ago and newer</option><option>60 days ago and newer</option><option>90 days ago and newer</option><option selected="selected">Any Date</option></select></div></fieldset></td><td width="50%" valign="top"><fieldset><legend><b>Sort results by...</b></legend><div style="padding:6px;"><select class="forminput" id="searchby"><option>Last Posting Date</option><option>Number of Replies</option><option>Poster Name</option><option>Topic Title</option></select><br /><input type="radio" id="sb1" checked="checked" onClick="this.checked = true; document.getElementById(\'sb2\').checked = false;" class="radiobutton" /> <label for="sb1">descending order</label><br /><input type="radio" id="sb2" onClick="this.checked = true; document.getElementById(\'sb1\').checked = false;" class="radiobutton" /> <label for="sb2">ascending order</label></div></fieldset></td></tr></table></td></tr></table><div class="pformstrip" align="center"><button class="forminput" id="searchbutton" onClick="PerformSearch();">Perform Search</button></div></div></div><iframe src="' + linkurl + 'index.php?act=idx&FindForums" width="1px" height="1px" frameborder="no"></iframe>'; } } }
if(window.location.href.match('&FindForums')) {
var searchforums = parent.document.getElementById('searchforums'); var forumcount = 0; var forumArray = new Array(); var catArray = new Array(); var x = document.getElementsByTagName('A'); for(i=0;i<x.length;i++) { if(x[i].href.match('showforum=') && x[i].parentNode.parentNode.className == 'row4') {
var categorybase = x[i].parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.childNodes[1].lastChild; var categoryname = categorybase.innerHTML;
if(categorybase.href == null) { var categoryname = categorybase.parentNode.parentNode.firstChild.lastChild.innerHTML; var categorynumb = categorybase.parentNode.parentNode.firstChild.lastChild.href.split('c=')[1]; } if(categorybase.href != null) { var categorynumb = categorybase.href.split('c=')[1]; }
if(catArray.toString().match(categoryname)) {
searchforums.options[(Math.floor(forumcount) + 1)] = new Option(' |--' + x[i].innerHTML, categorynumb + 'case' + x[i].href.split('showforum=')[1]);
var added = 0; var y = parent.document.getElementsByTagName('OPTION'); for(j=0;j<y.length;j++) { if(y[j].value == categorynumb + 'case' + x[i].href.split('showforum=')[1]) { var added = 1; }}
if(added == 0) { var doc = searchforums.ownerDocument; if(!doc) doc = searchforums.document; var opt = doc.createElement('OPTION'); opt.value = categorynumb + 'case' + x[i].href.split('showforum=')[1]; opt.text = ' |--' + x[i].innerHTML; searchforums.options.add(opt); }
} else { catArray[forumcount] = categoryname; searchforums.options[(Math.floor(forumcount) + 1)] = new Option(categoryname, 'cat' + categorynumb);
var added = 0; var y = parent.document.getElementsByTagName('OPTION'); for(j=0;j<y.length;j++) { if(y[j].value == 'cat' + categorynumb) { var added = 1; }}
if(added == 0) { var doc = searchforums.ownerDocument; if(!doc) doc = searchforums.document; var opt = doc.createElement('OPTION'); opt.value = 'cat' + categorynumb; opt.text = categoryname; searchforums.options.add(opt); }
searchforums.options[(Math.floor(forumcount) + 2)] = new Option(' |--' + x[i].innerHTML, categorynumb + 'case' + x[i].href.split('showforum=')[1]);
var added = 0; var y = parent.document.getElementsByTagName('OPTION'); for(j=0;j<y.length;j++) { if(y[j].value == categorynumb + 'case' + x[i].href.split('showforum=')[1]) { var added = 1; }}
if(added == 0) { var doc = searchforums.ownerDocument; if(!doc) doc = searchforums.document; var opt = doc.createElement('OPTION'); opt.value = categorynumb + 'case' + x[i].href.split('showforum=')[1]; opt.text = ' |--' + x[i].innerHTML; searchforums.options.add(opt); }
forumcount = Math.floor(forumcount) + 1; } forumcount = Math.floor(forumcount) + 1; }}
parent.document.getElementById('searchdiv').style.display = '';
}
function PerformSearch() { document.getElementById('searchbutton').disabled = true; newCookie('searchamount', (Math.floor(searchamount) + 1)); var searchresults = document.getElementById('searchresults'); searchresults.parentNode.style.display = 'none'; var keywords = document.getElementById('searchkeywords').value; var membername = document.getElementById('searchmembername').value; var matchname = document.getElementById('matchname'); if(matchname.checked == true) { var exactname = 1; } if(matchname.checked == false) { var exactname = 0; } var searchfrom = document.getElementById('searchfrom'); for(i=0;i<6;i++) { if(searchfrom.options[i].selected == true) { var sf = i; }} var searchby = document.getElementById('searchby'); for(i=0;i<4;i++) { if(searchby.options[i].selected == true) { var sb = i; }} if(document.getElementById('sb1').checked == true) { var sort_by = 'Z-A'; } if(document.getElementById('sb2').checked == true) { var sort_by = 'A-Z'; } switch(sf) { case 0: var prune_day = 1; break case 1: var prune_day = 7; break case 2: var prune_day = 30; break case 3: var prune_day = 60; break case 4: var prune_day = 90; break case 5: var prune_day = 100; break } switch(sb) { case 0: var sort_key = 'last_post'; break case 1: var sort_key = 'posts'; break case 2: var sort_key = 'starter_name'; break case 3: var sort_key = 'title'; }
var searchforums = document.getElementById('searchforums'); if(searchforums.options[0].selected == true) { searchforums.options[0].selected = false; var x = document.getElementsByTagName('OPTION'); for(i=0;i<x.length;i++) { if(x[i].parentNode.id == 'searchforums' && x[i].value.match('case')) { if(x[i].value.match('cat')) {} else { x[i].selected = true; }}}}
var x = document.getElementsByTagName('OPTION'); for(i=0;i<x.length;i++) { if(x[i].value.match('cat') && x[i].selected == true) { var catnumb = x[i].value.split('cat')[1];
for(j=0;j<x.length;j++) { if(x[j].value.match('case')) { if(x[j].value.split('case')[0] == catnumb) { x[j].selected = true; }}}
x[i].selected = false;
}}
var ct = 0; var forumsearch = ''; var x = document.getElementsByTagName('OPTION'); for(i=0;i<x.length;i++) { if(x[i].parentNode.id == 'searchforums' && x[i].selected == true) { forumsearch += '<iframe src="' + linkurl + 'index.php?showforum=' + x[i].value.split('case')[1] + '&prune_day=' + prune_day + '&sort_key=' + sort_key + '&sort_by=' + sort_by + '&SearchForums&st=0" width="1px" height="1px" frameborder="no"></iframe>'; ct++; }}
document.getElementById('searchresults').parentNode.innerHTML = srt; var searchframes = document.getElementById('searchframes'); searchframes.innerHTML = forumsearch; }
if(window.location.href.match('&SearchForums')) { var st = window.location.href.split('&st=')[1]; if(st.match('&')) { st = st.split('&')[0]; } var ct = 0; var searchresults = parent.document.getElementById('searchresults'); var newRow = searchresults.insertRow(-1); var newCell = newRow.insertCell(0); newCell.id = 'ForumName'; newCell.className = 'pformstrip'; newCell.colSpan = '7'; newCell.align = 'left'; newCell.innerHTML = '<a href="' + window.location.href.split('&')[0] + '&st=' + st + '">' + document.title.split(' -> ')[1] + '</a>'; if(st != '0') { newCell.innerHTML = '<span style="float:right;">(' + st + ')</span><a href="' + window.location.href.split('&')[0] + '&st=' + st + '">' + document.title.split(' -> ')[1] + '</a>'; } var results = new Array(); var x = document.getElementsByTagName('TD'); for(i=0;i<x.length;i++) { if(x[i].className == 'row4' && x[i].parentNode.cells[2] != null) { if(x[i].parentNode.cells[2] == x[i]) { if(x[i].innerHTML.toLowerCase().match(parent.document.getElementById('searchkeywords').value.toLowerCase())) {
if(parent.document.getElementById('matchname').checked == true) { if(x[i].parentNode.cells[3].firstChild.innerHTML == parent.document.getElementById('searchmembername').value) { searchresults.parentNode.style.display = ''; var newRow = searchresults.insertRow(-1); for(j=0;j<7;j++) { var newCell = newRow.insertCell(j); newCell.className = 'row2'; if((j/2).toString().match('.5')) { newCell.className = 'row4'; } newCell.align = x[i].parentNode.cells[j].align; newCell.innerHTML = x[i].parentNode.cells[j].innerHTML; if(j == 4) { var authorcell = x[i].parentNode.cells[j].childNodes[1]; if(authorcell == null) { var authorcell = x[i].parentNode.cells[j].childNodes[0]; } newCell.innerHTML = authorcell.innerHTML; } } } }
if(parent.document.getElementById('matchname').checked == false) { if(x[i].parentNode.cells[3].firstChild.innerHTML.toLowerCase().match(parent.document.getElementById('searchmembername').value.toLowerCase())) { searchresults.parentNode.style.display = ''; var newRow = searchresults.insertRow(-1); for(j=0;j<7;j++) { var newCell = newRow.insertCell(j); newCell.className = 'row2'; if((j/2).toString().match('.5')) { newCell.className = 'row4'; } newCell.align = x[i].parentNode.cells[j].align; newCell.innerHTML = x[i].parentNode.cells[j].innerHTML; if(j == 4) { var authorcell = x[i].parentNode.cells[j].childNodes[1]; if(authorcell == null) { var authorcell = x[i].parentNode.cells[j].childNodes[0]; } newCell.innerHTML = authorcell.innerHTML; } } }
ct++; }}}}}
var st = window.location.href.split('&st=')[1];
var x = document.getElementsByTagName('A'); for(i=0;i<x.length;i++) { if(x[i].href.match('&st=')) { if(x[i].href.match('&showtopic=')) {} else { var linkst = x[i].href.split('&st=')[1]; if(linkst.match('&')) { linkst = linkst.split('&')[0]; } if(Math.floor(linkst) > Math.floor(st)) { window.location = x[i].href + '&SearchForums'; }} }} }
|
|
|
| |
|
Volksdevil-ZNR
|
Jan 24 2010, 08:32 PM
Post #2
|
- Posts:
- 12
- Group:
- Members
- Member
- #383,278
- Joined:
- January 18, 2010
|
To simplify my request, a drop down to take care of these is what i was thinking:
Show active since Yesterday 2 days ago 3 days ago 4 days ago 5 days ago 6 days ago Last Week Last Month
|
|
|
| |
|
Holysavior-ZNR
|
Feb 9 2010, 10:02 PM
Post #3
|
- Posts:
- 1,236
- Group:
- Members
- Member
- #18,402
- Joined:
- July 7, 2004
|
you cant really search by those times. sorry. this cant really be done.
|
|
|
| |
|
Volksdevil-ZNR
|
Feb 15 2010, 03:09 PM
Post #4
|
- Posts:
- 12
- Group:
- Members
- Member
- #383,278
- Joined:
- January 18, 2010
|
It's a standard invisionfree feature though (Which has never worked) so surely something can be put together? Or the invision team can just fix it?!
It's not worked for at least 5 years!
|
|
|
| |
|
Reid
|
Feb 22 2010, 12:28 AM
Post #5
|
È una trappola!
- Posts:
- 6,767
- Group:
- Developer
- Member
- #223,645
- Joined:
- October 30, 2006
- I'm Browsing With
- Firefox
|
Ticket Incomplete
The code team does not have direct access to the code behind either invisionfree or zetaboards; as such, we can't fix any problems in the original implementations. Brandon has to be the one to do that. While a code could surely be created to fix the feature, it would be large, time-consuming, bandwidth- and hosting-requiring, and all in all, a huge effort for very little pay off. If hosting was free, I would make the code... but it does. 
If you have any questions regarding this topic, feel free to PM me. 
Have a nice day.
Edited by Reid, Feb 22 2010, 12:30 AM.
|
|
|
| |
| 1 user reading this topic (1 Guest and 0 Anonymous)
|