Quick Search for:  in language:    
With,code,make,multiple,link,page,view,result
   Code/Articles  |  Newest/Best  |  Community  |  Jobs  |  Other  |  Goto  | 
CategoriesSearch Newest CodeCoding ContestCode of the DayAsk A ProJobsUpload
ColdFusion Stats

 Code: 5,644. lines
 Jobs: 19. postings

 How to support the site

 
Sponsored by:

 
You are in:
 

Does your code think in ink?
Login





Latest Code Ticker for ColdFusion.
There is currently no new code. Please check back soon.
Click here to put this ticker on your site!


Add this ticker to your desktop!


Daily Code Email
To join the 'Code of the Day' Mailing List click here!

Affiliate Sites



 
 
   

MuLoT Paging

Print
Email
 
VB icon
Submitted on: 4/17/2003 10:45:36 AM
By: Le MuLoT  
Level: Beginner
User Rating: Unrated
Compatibility:Cold Fusion MX

Users have accessed this code 1433 times.
 

(About the author)
 
     With this code, you can make multiple link page to view results from a Search or a Query. Just look like this: |1| |2| |3| |4|
 
Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!

    //**************************************
    //     
    // for :MuLoT Paging
    //**************************************
    //     
    Call the function like this:
    #MuLoT_Paging(5, SearchResults.RecordCount, URL.MaxRows, 
    	 			URL.StartRow, URL.Search, URL.Collection, 'recherche.cfm', '+')#
code:
Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
 
Terms of Agreement:   
By using this code, you agree to the following terms...   
1) You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.   
2) You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
3) You may link to this code from another website, but ONLY if it is not wrapped in a frame. 
4) You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.

    //**************************************
    //     
    // Name: MuLoT Paging
    // Description:With this code, you can m
    //     ake multiple link page to view results f
    //     rom a Search or a Query. Just look like 
    //     this: |1| |2| |3| |4|
    // By: Le MuLoT
    //
    //This code is copyrighted and has    // limited warranties.Please see http://
    //     www.Planet-Source-Code.com/vb/scripts/Sh
    //     owCode.asp?txtCodeId=76&lngWId;=9    //for details.    //**************************************
    //     
    
    	<cfscript>	/***************************************************************************************\
    		*	Auteur:	Frdric Gauthier-Boutin													*
    		*	Date:	15 avril 2003																*
    		*	Description:																		*
    		*		Fonction gnrant des sauts de pages (liens hypertexts).						*
    		*																						*
    		*		Arguments :																		*
    		*			Intervalle	=>	Contient le nombre de pages  afficher avant et aprs celle	*
    		*							en cours de consultation.									*
    		*			RecordCount	=>	Contient le nombre de rsultats pour la recherche			*
    		*			MaxRows		=>	Contient le nombre de rsultats par pages					*
    		*			StartRow	=>	Contient le numro de l'enregistrement en cours				*
    		*			Search		=>	Contient ce sur quoi on fait la recherche					*
    		*			Collection	=>	Indique avec quelle(s) collection(s) nous recherchons		*
    		*			GotoURL		=>	Contient l'URL vers lequel les liens des pages pointent		*
    		*																						*
    		*		Arguments Optionnels :															*	
    					Middle		=>
    		*	Version: #2.0																		*
    		\***************************************************************************************/	
    		function MuLoT_Paging(Intervalle, RecordCount, MaxRows, StartRow, Search, Collection, GotoURL) {
    			//Dclarations divers
    			var iCtr = 1;
    			var Start = 1;
    			var strPages = '';
    			var Middle = '#chr(35)#iCtr#chr(35)#'; //Correspond  #iCtr#, mais si crit tel quel, y a traitement tout de suite !!!
    			var BeginTag = '<font color="blue" face="Arial, Helvetica, sans-serif" size="3">';
    			var EndTag = '</font>';
    			var CurrentMiddle = Middle;
    			var CurrentBeginTag = '<font size="+1" color="blue">';
    			var CurrentEndTag = EndTag;
    			//Calcul des pages
    			var CurrentPage = (StartRow + MaxRows - 1) / MaxRows;
    			var BeginPage = 1;
    			var MaxPage = (recordCount / MaxRows);
    			if (RecordCount mod MaxRows NEQ 0) //Page de terminaison
    				MaxPage = MaxPage + 1;
    			//Vrification si nous avons reu des arguments supplmentaires
    			if(ArrayLen(arguments) GTE 8) 
    				Middle = "#chr(35)#arguments[8]#chr(35)#";
    			if(ArrayLen(arguments) GTE 9)
    				BeginTag = "#chr(35)#arguments[9]#chr(35)#";
    			if(ArrayLen(arguments) GTE 10)
    				EndTag = "#chr(35)#arguments[10]#chr(35)#";
    			if(ArrayLen(arguments) GTE 11)
    				CurrentMiddle = "#chr(35)#arguments[11]#chr(35)#";
    			//Ajustement de l'intervalle
    			if (CurrentPage + Intervalle LT MaxPage)
    				MaxPage = CurrentPage + Intervalle;
    			if (CurrentPage - Intervalle GT BeginPage)
    				BeginPage = CurrentPage - Intervalle;
    			//Boucle parcourant chaque pages
    			for(iCtr = BeginPage; iCtr LE MaxPage; iCtr = iCtr + 1){
    				//Calcul du Dbut pour chaque pages
    				Start = (iCtr * MaxRows) - MaxRows + 1;
    				//Vrification si page en cours
    				if (Start NEQ StartRow)
    					strPages = strPages & 'a href="#GotoURL#?
    										startrow=#Start#&
    										MaxRows=#MaxRows#&
    										search=#URLEncodedFormat("#Search#")#&
    										collection=#URLEncodedFormat("#Collection#")#&
    										Advanced=#URLEncodedFormat("#URL.Advanced#")#">'
    											& '#BeginTag#'
    											& Evaluate(Middle)
    											& '#EndTag#'
    											&'/a> ';
    				else
    					strPages = strPages & CurrentBeginTag & Evaluate(CurrentMiddle) & CurrentEndTag & ' ';
    			}
    			return strPages;
    		}	
    </cfscript>


Other 1 submission(s) by this author

 

 
Report Bad Submission
Use this form to notify us if this entry should be deleted (i.e contains no code, is a virus, etc.).
Reason:
 
Your Vote!

What do you think of this code(in the Beginner category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor See Voting Log
 
Other User Comments
4/22/2003 8:52:00 AM:Tim Garver
Would be cool if i could read French!
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
4/22/2003 9:08:21 AM:THA MuLoT
Do you want an english version ?
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
Add Your Feedback!
Note:Not only will your feedback be posted, but an email will be sent to the code's author in your name.

NOTICE: The author of this code has been kind enough to share it with you.  If you have a criticism, please state it politely or it will be deleted.

For feedback not related to this particular code, please click here.
 
Name:
Comment:

 

Categories | Articles and Tutorials | Advanced Search | Recommended Reading | Upload | Newest Code | Code of the Month | Code of the Day | All Time Hall of Fame | Coding Contest | Search for a job | Post a Job | Ask a Pro Discussion Forum | Live Chat | Feedback | Customize | ColdFusion Home | Site Home | Other Sites | About the Site | Feedback | Link to the Site | Awards | Advertising | Privacy

Copyright 1997 by Exhedra Solutions, Inc. All Rights Reserved.  By using this site you agree to its Terms and Conditions.  Planet Source Code (tm) and the phrase "Dream It. Code It" (tm) are trademarks of Exhedra Solutions, Inc.