The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#11
|
|||
|
|||
![]()
Was this mod ever released? I couldn't find it. Thanks in advance.
|
#12
|
||||
|
||||
![]()
what mod is that?
|
#13
|
|||
|
|||
![]()
This one --- Unless I misunderstood --- I was looking for a mod to allow for searching by specific date.
| | | | V |
#14
|
|||
|
|||
![]()
hey am sorry i culdnt gve u the mod in time......i was away for some time....
Now these are the changes i hav done to implement search by date range... i suggest u take a backup of yuor files before changing nything... Follow the steps carefully and you would achieve your results : Steps --------- A ) Change is Template files Changes in search_forums template _________________________ 1 : ) At the start line no : 1 ...Add Code : <!-- Punterz search b/w date range 12/03/2008 --> <LINK href="css/calendar-blue.css" type="text/css" rel="stylesheet"> <script src="js/calendar.js" type="text/javascript"></script> <script src="js/calendar-en.js" type="text/javascript"></script> <script src="js/calendar-setup.js" type="text/javascript"></script> <script type="text/javascript"> function check1() { if (vbform.s_opt1.checked==true) { vbform.soptdate.readOnly=true; vbform.eoptdate.readOnly=true; vbform.soptdate.title=""; vbform.eoptdate.title=""; vbform.triggerFrom.disabled=true; vbform.triggerTo.disabled=true; vbform.triggerFrom.style.visibility="hidden"; vbform.triggerTo.style.visibility="hidden"; vbform.searchdate.disabled=false; vbform.beforeafter.disabled=false; } else if (vbform.s_opt2.checked==true) { vbform.soptdate.readOnly=false; vbform.eoptdate.readOnly=false; vbform.triggerFrom.disabled=false; vbform.triggerTo.disabled=false; vbform.triggerFrom.style.visibility="visible"; vbform.triggerTo.style.visibility="visible"; vbform.soptdate.title="Click the adjacent Calender image to select the From Date"; vbform.eoptdate.title="Click the adjacent Calender image to select the To Date"; vbform.searchdate.disabled=true; vbform.beforeafter.disabled=true; } } </script> <script type="text/javascript"> function enab() { vbform.soptdate.disabled=true; vbform.eoptdate.disabled=true; vbform.soptdate.value=""; vbform.eoptdate.value=""; vbform.soptdate.title=""; vbform.eoptdate.title=""; vbform.triggerFrom.disabled=true; vbform.triggerTo.disabled=true; vbform.triggerFrom.style.visibility="hidden"; vbform.triggerTo.style.visibility="hidden"; vbform.searchdate.disabled=false; vbform.beforeafter.disabled=false; } </script> <script type="text/javascript"> function enab1() { vbform.soptdate.disabled=false; vbform.eoptdate.disabled=false; vbform.soptdate.readOnly=true; vbform.eoptdate.readOnly=true; vbform.triggerFrom.style.visibility="visible"; vbform.triggerTo.style.visibility="visible"; vbform.soptdate.title="Click the adjacent Calender image to select the From Date"; vbform.eoptdate.title="Click the adjacent Calender image to select the To Date"; vbform.triggerFrom.disabled=false; vbform.triggerTo.disabled=false; vbform.searchdate.disabled=true; vbform.beforeafter.disabled=true; } </script> <!-- Punterz search b/w date range 12/03/2008 --> 2 ![]() with : <body onLoad="check()"> 3 ![]() After </form> tag Add this Code : <!-- Punterz search b/w date range 12/03/2008 --> <script type="text/javascript"> Calendar.setup( { inputField : "soptdate", // ID of the input field ifFormat : "%Y-%m-%d", // the date format button : "triggerFrom" // ID of the button } ); </script> <script type="text/javascript"> Calendar.setup( { inputField : "eoptdate", // ID of the input field ifFormat : "%Y-%m-%d", // the date format button : "triggerTo" // ID of the button } ); <!-- Punterz search b/w date range 12/03/2008 --> </script> 4 ![]() Starting with : <fieldset class="fieldset"> <div style="padding:$stylevar[formspacer]px"> <legend>$vbphrase[find_posts_from]</legend> .....................................till......... ..................... </fieldset> Replace this fieldset to fieldset code with : <fieldset class="fieldset"> <div style="padding:$stylevar[formspacer]px"> <legend>$vbphrase[find_posts_from]</legend> <div style="padding:$stylevar[formspacer]px"> <input type='radio' name='find_opt' value='0' $find_optchecked[0] onClick="enab()" id="s_opt1" checked="true"/> Previous Visits </div> <br> <div align='left'> &n bsp; <select name="searchdate" style="width:150px" id="searchdate"> <option value="0" $searchdateselected[0]>$vbphrase[any_date]</option> <option value="lastvisit" $searchdateselected[lastvisit]>$vbphrase[your_last_visit]</option> <option value="1" $searchdateselected[1]>$vbphrase[yesterday]</option> <option value="7" $searchdateselected[7]>$vbphrase[a_week_ago]</option> <option value="14" $searchdateselected[14]><phrase 1="2">$vbphrase[x_weeks_ago]</phrase></option> <option value="30" $searchdateselected[30]>$vbphrase[a_month_ago]</option> <option value="90" $searchdateselected[90]><phrase 1="3">$vbphrase[x_months_ago]</phrase></option> <option value="180" $searchdateselected[180]><phrase 1="6">$vbphrase[x_months_ago]</phrase></option> <option value="365" $searchdateselected[365]>$vbphrase[a_year_ago]</option> </select> &n bsp; &nbs p; <select name="beforeafter"> <option value="after" $beforeafterselected[after]>$vbphrase[and_newer]</option> <option value="before" $beforeafterselected[before]>$vbphrase[and_older]</option> </select> </div> <!-- Select --> <br> <hr width=95% color="#D0D0BF"> <!-- Select Range Punterz Search by Date Range 12/03/2008--> <div style="padding:$stylevar[formspacer]px"> <input type='radio' name='find_opt' value='1' id="s_opt2" $find_optchecked[1] onClick="enab1()"/> Select Range </div> <br> <div width='100%' style="text-align: center"> <table width='100%' cellpadding='1' cellspacing='0' align='center' z-index="-1"> <tr> <td width="50%"> From : <input type="text" class="bginput" style="font-size:11px" name="soptdate" size="10" maxlength="10" id="soptdate" align="center" value="$soptdate" /> <!-- aaa --> <img src="images/cal.gif" width="16" height="16" border="0" alt="Click Here to Select From Date" id="triggerFrom" style="visibility:hidden" style="cursor: pointer;" > </td> <td width="50%"> &n bsp; To : <input type="text" class="bginput" style="font-size:11px" name="eoptdate" size="10" maxlength="10" id="eoptdate" align="center" value="$eoptdate" /> <!-- aaa --> <img src="images/cal.gif" width="16" height="16" border="0" alt="Click Here to Select To Date" id="triggerTo" style="visibility:hidden" style="cursor: pointer;"> </td> </tr> <tr> <td colspan='2' height='18'>$vbphrase[date_format]$conf_dformat</td> </tr> </table> </div> <!-- Punterz search b/w date range 12/03/2008 --> </fieldset> --------------------------------------------------------------------------------------------------------- Changes made to search.php ___________________________ 1: ) Add the code aftre line no : 91 'soptdate' => TYPE_STR, 'eoptdate' => TYPE_STR, 'find_opt' => TYPE_STR, 2 : ) At line no 1424 replace this : //$thread_select_logic[] = "DISTINCT thread.threadid"; with this : $thread_select_logic[] = "DISTINCT thread.threadid,thread.dateline"; 3 : ) At line no : 1282 search for : a. // check if we are searching for posts from a specific time period b.// check to see if there are conditions attached to number of thread replies Replace any code between a and b with this : if (($vbulletin->GPC['find_opt'])==0) { if ($vbulletin->GPC['searchdate'] != 'lastvisit') { $vbulletin->GPC['searchdate'] = intval($vbulletin->GPC['searchdate']); } if ($vbulletin->GPC['searchdate']) { switch($vbulletin->GPC['searchdate']) { case 'lastvisit': // get posts from before/after last visit $datecut = $vbulletin->userinfo['lastvisit']; break; case 0: // do not specify a time period $datecut = 0; break; default: // get posts from before/after specified time period $datecut = TIMENOW - $vbulletin->GPC['searchdate'] * 86400; } if ($datecut) { switch($vbulletin->GPC['beforeafter']) { // get posts from before $datecut case 'before': $post_query_logic[] = "post.dateline < $datecut"; break; // get posts from after $datecut default: $post_query_logic[] = "post.dateline > $datecut "; } } unset($datecut); } } // ################################################## ########################### else if (($vbulletin->GPC['find_opt'])==1) { $fromdate= "'".$vbulletin->GPC['soptdate']."'"; $todate = "'".$vbulletin->GPC['eoptdate']."'"; $post_query_logic[] = "date(FROM_UNIXTIME(thread.dateline)) >= $fromdate AND date(FROM_UNIXTIME(thread.dateline)) <= $todate"; } Upload calender-blue.css in your CSS folder Upload calender.js, calender-en.js and calender-setup.js is your js folder and cal.gif in your images folder These files are available in files.zip as an attachment in this post. Do let me know if u face any problems. |
![]() |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|