|  | 
| 
			 
			#1  
			
			
			
			
			
		 | ||||
| 
 | ||||
|  Showing stats on click page 
			
			Hello! Sorry for yet another nuisance, but I've been trying to find a way to display an adoptable's stats on its levelup page after someone has viewed it more than once. I was thinking about having the stats displayed on the second view and adding a link after the first click, but I can't seem to get anything to work. I'm currently using version 1.3.3. Would anyone mind helping me?  PHP Code: 
			Thank you so much! Last edited by Hwona; 05-04-2014 at 09:40 AM. | 
| 
			 
			#2  
			
			
			
			
			
		 | ||||
| 
 | ||||
|   PHP Code: 
			I don't quite remember the appending operator, but you can do this: $message = "Name: {$adoptablename}<br> Species: {$species}<br> Gender: {$gender}<br> Total Clicks: {$totalclicks}<br> Trade Status: {$tradestatus}<br>"; $message = $message .= (($mysidia->user instanceof Member)?$mysidia->lang->already_leveled_member:$mysidia->lang->already_leveled_guest); PHP Code: 
			
				__________________    asp.net stole my soul. | 
| 
			 
			#3  
			
			
			
			
			
		 | ||||
| 
 | ||||
|  Re 
			
			Thank you so much! It worked! Err, I tried to do the same thing for the situation with a frozen adoptable and then link the click page to itself to refresh, but nothing is appearing. PHP Code: 
			 | 
| 
			 
			#4  
			
			
			
			
			
		 | ||||
| 
 | ||||
|   
			
			Glad it worked! You need to add the message to the document/page, instead of $document->addLangvar($mysidia->lang->frozen); you need to have $document->addLangvar($message); 
				__________________    asp.net stole my soul. | 
| 
			 
			#5  
			
			
			
			
			
		 | ||||
| 
 | ||||
|  Re 
			
			Okey dokey! Thank you again! Everything is up and running! By any chance, do you know what the "last bred" numbers mean? :3 | 
| 
			 
			#6  
			
			
			
			
			
		 | ||||
| 
 | ||||
|   
			
			I believe it's a unix timestamp. You can do this to format it to show a readable date $dt = new DateTime( "@" . $this->adopt->getLastBred() ); $lastbred = $dt->format('Y-m-d'); 
				__________________    asp.net stole my soul. | 
| 
			 
			#7  
			
			
			
			
			
		 | ||||
| 
 | ||||
|  Re 
			
			I think I'm done for now! Thanks again! - I think you've done most of the work for me. XP
		 | 
| 
			 
			#8  
			
			
			
			
			
		 | ||||
| 
 | ||||
|  Re 
			
			Oops, one more thing! Now I'm getting an error with the datetime - frozen adoptables only: DateTime::__construct(): Failed to parse time string (@) at position 0 (@): Unexpected character Do I need to edit the datetime to show 0 when the adoptable hasn't been bred? I can't seem to find it... XP Edit: nevermind, I found a way to fix it, but I want to replace 1970-01-01 with 0 Last edited by Hwona; 05-06-2014 at 08:12 AM. | 
| 
			 
			#9  
			
			
			
			
			
		 | ||||
| 
 | ||||
|   Quote: 
 What about $lastbred = 0;//this way lastbred is always 0 if getLastBred() also returns 0 if($this->adopt->getLastBred() != 0){ $dt = new DateTime( "@" . $this->adopt->getLastBred() ); $lastbred = $dt->format('Y-m-d'); } 
				__________________    asp.net stole my soul. | 
| 
			 
			#10  
			
			
			
			
			
		 | ||||
| 
 | ||||
|  Re 
			
			Yay! It works! :D
		 | 
|  | 
| Thread Tools | |
| Display Modes | |
| 
 | 
 | 
|  Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post | 
| Editing Stats Page & Little Icon | Glow | Questions and Supports | 4 | 12-07-2014 08:29 AM | 
| Online list ... and a Stats Page for Players | Missy Master | Questions and Supports | 2 | 07-07-2014 09:58 AM | 
| Help Making Stats Page = Click Page & Lineages? | squiggler | Questions and Supports | 2 | 02-22-2014 04:42 AM | 
| Adoptable Stats | Abronsyth | Suggestions and Feature Requests | 2 | 09-10-2011 02:28 PM | 
| Random Adoptable Click page | AlkseeyaKC | Suggestions and Feature Requests | 4 | 07-01-2011 02:49 PM | 
| What's New? | What's Hot? | What's Popular? |