-
-
Save codesharpdev/512aa88bdf18bee8f7f1fe820c76b3e5 to your computer and use it in GitHub Desktop.
Revisions
-
steinbring revised this gist
Dec 17, 2012 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -22,7 +22,7 @@ <cfset intMaxLinkToShow = ceiling(intNumberOfTotalItems / intItemsPerPage)> </cfif> <!--- Should I show the back button? ---> <cfif intMaxLinkToShow - intPagesToLinkTo LTE 0> <cfset boolShowBackButton = 0> <cfelse> <cfset boolShowBackButton = 1> -
steinbring revised this gist
Dec 17, 2012 . 1 changed file with 0 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,3 @@ <!--- How many pages should you link to at any one time? ---> <cfset intPagesToLinkTo = 5> <!--- How many items are you displaying per page? ---> -
steinbring revised this gist
Dec 17, 2012 . 1 changed file with 36 additions and 36 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -17,66 +17,66 @@ <cfset intMinLinkToShow = (int(variables.intCurrentPage/intPagesToLinkTo)*intPagesToLinkTo)+1> <!--- Is intMaxLinkToShow equal to the unadjusted intMinLinkToShow value? If so, reset intMinLinkToShow to be where it should be. ---> <cfif intMaxLinkToShow eq (int(variables.intCurrentPage/intPagesToLinkTo)*intPagesToLinkTo)> <cfset intMinLinkToShow = intMaxLinkToShow - (intPagesToLinkTo - 1)> </cfif> <!--- Is intMaxLinkToShow bigger than we need to shouw intNumberOfTotalItems? If so, reset it. Use ceiling() to round it up. ---> <cfif intMaxLinkToShow gt intNumberOfTotalItems / intItemsPerPage> <cfset intMaxLinkToShow = ceiling(intNumberOfTotalItems / intItemsPerPage)> </cfif> <!--- Should I show the back button? ---> <cfif intMaxLinkToShow - intPagesToLinkTo EQ 0> <cfset boolShowBackButton = 0> <cfelse> <cfset boolShowBackButton = 1> </cfif> <!--- Should I show the forward button? ---> <cfif ceiling(intNumberOfTotalItems / intItemsPerPage) lte intMaxLinkToShow> <cfset boolShowForwardButton = 0> <cfelse> <cfset boolShowForwardButton = 1> </cfif> <!--- What items should I show on the page? ---> <cfset intMinItemsToShow = (intItemsPerPage * (intCurrentPage - 1))+ 1> <cfset intMaxItemsToShow = intMinItemsToShow + intItemsPerPage - 1> <!--- Have you reached the maximum number of items to show? ---> <cfif intMaxItemsToShow gt intNumberOfTotalItems> <cfset intMaxItemsToShow = intNumberOfTotalItems> </cfif> <!--- Display the results ---> <div> <cfloop from="#variables.intMinItemsToShow#" to="#variables.intMaxItemsToShow#" index="i"> <div style="float:left;font-weight:bold;margin:10px;padding:20px;border:1px solid black;"> <cfoutput>#i#</cfoutput> </div> </cfloop> </div> <!--- Display the pagination buttons ---> <div style="clear:both; margin-top:10px;"> <!--- Show a "back button" that link to the smallest number page - 1 ---> <cfif variables.boolShowBackButton> <div style="float:left;font-weight:bold;margin:5px;padding:5px;border:1px solid black;"> <a href="?page=<cfoutput>#intMinLinkToShow-1#</cfoutput>"><</a> </div> </cfif> <!--- Loop through and create links to intPagesToLinkTo pages ---> <cfloop from="#variables.intMinLinkToShow#" to="#variables.intMaxLinkToShow#" index="i"> <div style="float:left;font-weight:bold;margin:5px;padding:5px;border:1px solid black;"> <cfoutput> <cfif intCurrentPage eq i> #i# <cfelse> <a href="?page=#i#">#i#</a> </cfif> </cfoutput> </div> </cfloop> <!--- Show a "forward button" that links to the largest number page + 1 ---> <cfif variables.boolShowForwardButton> <div style="float:left;font-weight:bold;margin:5px;padding:5px;border:1px solid black;"> <a href="?page=<cfoutput>#intMaxLinkToShow+1#</cfoutput>">></a> </div> </cfif> </div> <div style="clear:both;"></div> -
steinbring revised this gist
Dec 17, 2012 . 1 changed file with 36 additions and 36 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -17,66 +17,66 @@ <cfset intMinLinkToShow = (int(variables.intCurrentPage/intPagesToLinkTo)*intPagesToLinkTo)+1> <!--- Is intMaxLinkToShow equal to the unadjusted intMinLinkToShow value? If so, reset intMinLinkToShow to be where it should be. ---> <cfif intMaxLinkToShow eq (int(variables.intCurrentPage/intPagesToLinkTo)*intPagesToLinkTo)> <cfset intMinLinkToShow = intMaxLinkToShow - (intPagesToLinkTo - 1)> </cfif> <!--- Is intMaxLinkToShow bigger than we need to shouw intNumberOfTotalItems? If so, reset it. Use ceiling() to round it up. ---> <cfif intMaxLinkToShow gt intNumberOfTotalItems / intItemsPerPage> <cfset intMaxLinkToShow = ceiling(intNumberOfTotalItems / intItemsPerPage)> </cfif> <!--- Should I show the back button? ---> <cfif intMaxLinkToShow - intPagesToLinkTo EQ 0> <cfset boolShowBackButton = 0> <cfelse> <cfset boolShowBackButton = 1> </cfif> <!--- Should I show the forward button? ---> <cfif ceiling(intNumberOfTotalItems / intItemsPerPage) lte intMaxLinkToShow> <cfset boolShowForwardButton = 0> <cfelse> <cfset boolShowForwardButton = 1> </cfif> <!--- What items should I show on the page? ---> <cfset intMinItemsToShow = (intItemsPerPage * (intCurrentPage - 1))+ 1> <cfset intMaxItemsToShow = intMinItemsToShow + intItemsPerPage - 1> <!--- Have you reached the maximum number of items to show? ---> <cfif intMaxItemsToShow gt intNumberOfTotalItems> <cfset intMaxItemsToShow = intNumberOfTotalItems> </cfif> <!--- Display the results ---> <div> <cfloop from="#variables.intMinItemsToShow#" to="#variables.intMaxItemsToShow#" index="i"> <div style="float:left;font-weight:bold;margin:10px;padding:20px;border:1px solid black;"> <cfoutput>#i#</cfoutput> </div> </cfloop> </div> <!--- Display the pagination buttons ---> <div style="clear:both; margin-top:10px;"> <!--- Show a "back button" that link to the smallest number page - 1 ---> <cfif variables.boolShowBackButton> <div style="float:left;font-weight:bold;margin:5px;padding:5px;border:1px solid black;"> <a href="?page=<cfoutput>#intMinLinkToShow-1#</cfoutput>"><</a> </div> </cfif> <!--- Loop through and create links to intPagesToLinkTo pages ---> <cfloop from="#variables.intMinLinkToShow#" to="#variables.intMaxLinkToShow#" index="i"> <div style="float:left;font-weight:bold;margin:5px;padding:5px;border:1px solid black;"> <cfoutput> <cfif intCurrentPage eq i> #i# <cfelse> <a href="?page=#i#">#i#</a> </cfif> </cfoutput> </div> </cfloop> <!--- Show a "forward button" that links to the largest number page + 1 ---> <cfif variables.boolShowForwardButton> <div style="float:left;font-weight:bold;margin:5px;padding:5px;border:1px solid black;"> <a href="?page=<cfoutput>#intMaxLinkToShow+1#</cfoutput>">></a> </div> </cfif> </div> <div style="clear:both;"></div> -
steinbring revised this gist
Dec 17, 2012 . 1 changed file with 37 additions and 37 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -10,73 +10,73 @@ <cfif isdefined("url.page")> <cfset intCurrentPage = val(url.page)> <cfelse> <cfset intCurrentPage = 1> </cfif> <!--- Find the closest numbers to intCurrentPage that is divisible by intPagesToLinkTo ---> <cfset intMaxLinkToShow = ceiling(variables.intCurrentPage/intPagesToLinkTo)*intPagesToLinkTo> <cfset intMinLinkToShow = (int(variables.intCurrentPage/intPagesToLinkTo)*intPagesToLinkTo)+1> <!--- Is intMaxLinkToShow equal to the unadjusted intMinLinkToShow value? If so, reset intMinLinkToShow to be where it should be. ---> <cfif intMaxLinkToShow eq (int(variables.intCurrentPage/intPagesToLinkTo)*intPagesToLinkTo)> <cfset intMinLinkToShow = intMaxLinkToShow - (intPagesToLinkTo - 1)> </cfif> <!--- Is intMaxLinkToShow bigger than we need to shouw intNumberOfTotalItems? If so, reset it. Use ceiling() to round it up. ---> <cfif intMaxLinkToShow gt intNumberOfTotalItems / intItemsPerPage> <cfset intMaxLinkToShow = ceiling(intNumberOfTotalItems / intItemsPerPage)> </cfif> <!--- Should I show the back button? ---> <cfif intMaxLinkToShow - intPagesToLinkTo EQ 0> <cfset boolShowBackButton = 0> <cfelse> <cfset boolShowBackButton = 1> </cfif> <!--- Should I show the forward button? ---> <cfif ceiling(intNumberOfTotalItems / intItemsPerPage) lte intMaxLinkToShow> <cfset boolShowForwardButton = 0> <cfelse> <cfset boolShowForwardButton = 1> </cfif> <!--- What items should I show on the page? ---> <cfset intMinItemsToShow = (intItemsPerPage * (intCurrentPage - 1))+ 1> <cfset intMaxItemsToShow = intMinItemsToShow + intItemsPerPage - 1> <!--- Have you reached the maximum number of items to show? ---> <cfif intMaxItemsToShow gt intNumberOfTotalItems> <cfset intMaxItemsToShow = intNumberOfTotalItems> </cfif> <!--- Display the results ---> <div> <cfloop from="#variables.intMinItemsToShow#" to="#variables.intMaxItemsToShow#" index="i"> <div style="float:left;font-weight:bold;margin:10px;padding:20px;border:1px solid black;"> <cfoutput>#i#</cfoutput> </div> </cfloop> </div> <!--- Display the pagination buttons ---> <div style="clear:both; margin-top:10px;"> <!--- Show a "back button" that link to the smallest number page - 1 ---> <cfif variables.boolShowBackButton> <div style="float:left;font-weight:bold;margin:5px;padding:5px;border:1px solid black;"> <a href="?page=<cfoutput>#intMinLinkToShow-1#</cfoutput>"><</a> </div> </cfif> <!--- Loop through and create links to intPagesToLinkTo pages ---> <cfloop from="#variables.intMinLinkToShow#" to="#variables.intMaxLinkToShow#" index="i"> <div style="float:left;font-weight:bold;margin:5px;padding:5px;border:1px solid black;"> <cfoutput> <cfif intCurrentPage eq i> #i# <cfelse> <a href="?page=#i#">#i#</a> </cfif> </cfoutput> </div> </cfloop> <!--- Show a "forward button" that links to the largest number page + 1 ---> <cfif variables.boolShowForwardButton> <div style="float:left;font-weight:bold;margin:5px;padding:5px;border:1px solid black;"> <a href="?page=<cfoutput>#intMaxLinkToShow+1#</cfoutput>">></a> </div> </cfif> </div> <div style="clear:both;"></div> -
steinbring renamed this gist
Dec 17, 2012 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
steinbring created this gist
Dec 17, 2012 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,82 @@ <!--- What page are you currently on? ---> <cfset intSelection = 5> <!--- How many pages should you link to at any one time? ---> <cfset intPagesToLinkTo = 5> <!--- How many items are you displaying per page? ---> <cfset intItemsPerPage = 10> <!--- How many items do you need to display, across all pages. ---> <cfset intNumberOfTotalItems = 100> <!--- What is the current page you are on? ---> <cfif isdefined("url.page")> <cfset intCurrentPage = val(url.page)> <cfelse> <cfset intCurrentPage = 1> </cfif> <!--- Find the closest numbers to intCurrentPage that is divisible by intPagesToLinkTo ---> <cfset intMaxLinkToShow = ceiling(variables.intCurrentPage/intPagesToLinkTo)*intPagesToLinkTo> <cfset intMinLinkToShow = (int(variables.intCurrentPage/intPagesToLinkTo)*intPagesToLinkTo)+1> <!--- Is intMaxLinkToShow equal to the unadjusted intMinLinkToShow value? If so, reset intMinLinkToShow to be where it should be. ---> <cfif intMaxLinkToShow eq (int(variables.intCurrentPage/intPagesToLinkTo)*intPagesToLinkTo)> <cfset intMinLinkToShow = intMaxLinkToShow - (intPagesToLinkTo - 1)> </cfif> <!--- Is intMaxLinkToShow bigger than we need to shouw intNumberOfTotalItems? If so, reset it. Use ceiling() to round it up. ---> <cfif intMaxLinkToShow gt intNumberOfTotalItems / intItemsPerPage> <cfset intMaxLinkToShow = ceiling(intNumberOfTotalItems / intItemsPerPage)> </cfif> <!--- Should I show the back button? ---> <cfif intMaxLinkToShow - intPagesToLinkTo EQ 0> <cfset boolShowBackButton = 0> <cfelse> <cfset boolShowBackButton = 1> </cfif> <!--- Should I show the forward button? ---> <cfif ceiling(intNumberOfTotalItems / intItemsPerPage) lte intMaxLinkToShow> <cfset boolShowForwardButton = 0> <cfelse> <cfset boolShowForwardButton = 1> </cfif> <!--- What items should I show on the page? ---> <cfset intMinItemsToShow = (intItemsPerPage * (intCurrentPage - 1))+ 1> <cfset intMaxItemsToShow = intMinItemsToShow + intItemsPerPage - 1> <!--- Have you reached the maximum number of items to show? ---> <cfif intMaxItemsToShow gt intNumberOfTotalItems> <cfset intMaxItemsToShow = intNumberOfTotalItems> </cfif> <!--- Display the results ---> <div> <cfloop from="#variables.intMinItemsToShow#" to="#variables.intMaxItemsToShow#" index="i"> <div style="float:left;font-weight:bold;margin:10px;padding:20px;border:1px solid black;"> <cfoutput>#i#</cfoutput> </div> </cfloop> </div> <!--- Display the pagination buttons ---> <div style="clear:both; margin-top:10px;"> <!--- Show a "back button" that link to the smallest number page - 1 ---> <cfif variables.boolShowBackButton> <div style="float:left;font-weight:bold;margin:5px;padding:5px;border:1px solid black;"> <a href="?page=<cfoutput>#intMinLinkToShow-1#</cfoutput>"><</a> </div> </cfif> <!--- Loop through and create links to intPagesToLinkTo pages ---> <cfloop from="#variables.intMinLinkToShow#" to="#variables.intMaxLinkToShow#" index="i"> <div style="float:left;font-weight:bold;margin:5px;padding:5px;border:1px solid black;"> <cfoutput> <cfif intCurrentPage eq i> #i# <cfelse> <a href="?page=#i#">#i#</a> </cfif> </cfoutput> </div> </cfloop> <!--- Show a "forward button" that links to the largest number page + 1 ---> <cfif variables.boolShowForwardButton> <div style="float:left;font-weight:bold;margin:5px;padding:5px;border:1px solid black;"> <a href="?page=<cfoutput>#intMaxLinkToShow+1#</cfoutput>">></a> </div> </cfif> </div> <div style="clear:both;"></div>