Skocz do zawartości


- - - - -

(DP23) Custom Pages


  • Nie możesz odpowiedzieć
34 odpowiedzi w tym temacie

#31 KaToSpY

  • Użytkownik
  • 5 postów
  • Wersja:n/c

Napisano 12 sierpień 2010 - 22:35

yes , i set this mod , then i had writen about 100 pages and all pages are on one page

may be this code you typed for 3.x not for 2.3.x


i redownloaded the mod files and there is no pagination code

mod files....

pages.php

dp23_cuspg.php

for 2.3.x ............. ?!

i searched for the pagination code and not found it

where is this code found , in which file ?



if this code for ipb 3.x

can you provide me with 2.3.x code :)

#32 DawPi

    ...a wy Pragnienie™

  • Manager
  • 49506 postów
  • Wersja:IP.Board 3.2.3

Napisano 15 sierpień 2010 - 09:28

Ohh, sorry.. This was for 3.x series.. :)

Open file: sources/components_public/pages.php

Change whole all() function to:
	function all()
	{
	    /* INIT */
	    
		$this->title = $this->ipsclass->lang['dp23_allpages'];
		
		$start   = intval($this->ipsclass->input['st']) >=0 ? intval($this->ipsclass->input['st']) : 0;
		
		$perpage = 20;	
		
		/* Count all pages */
		
		$this->ipsclass->DB->simple_construct( array( 
	                        'select' 	=> 'COUNT(*) as total',
						    'from'   	=> 'dp23_cuspg',
						)      );
	
	    $this->ipsclass->DB->simple_exec();
				
	    $count = $this->ipsclass->DB->fetch_row();
	    
		/* Build pagination */
			
		$pagination = $this->ipsclass->build_pagelinks( array(    'TOTAL_POSS'  => $count['total'],
																	'PER_PAGE'    => $perpage,
																	'CUR_ST_VAL'  => $start,
																	'L_SINGLE'    => "Single Page",
																	'L_MULTI'     => "Pages: ",
																	'BASE_URL'    => $this->ipsclass->base_url . 'autocom=pages&st=' . $start,
															 )		);	
		
		/* Get all pages */
		
		$this->ipsclass->DB->simple_construct( array( 'select' => '*', 'from' => 'dp23_cuspg', 'where' => 'cp_active = 1', 'order' => 'cp_dateadded DESC', 'limit' => array( $start, $perpage ) ) );
		
		$this->ipsclass->DB->simple_exec();
		
		//-----------------------------------------
		// Show all pages...
		//-----------------------------------------	 
		
		$this->output  = $this->ipsclass->compiled_templates['skin_dp23_custom_pages']->dp23_cuspg_header($this->title, $pagination);	 
		$this->output .= $this->ipsclass->compiled_templates['skin_dp23_custom_pages']->dp23_cuspg_subheader();	
		
		if ($this->ipsclass->DB->get_num_rows())
		{	 	
			while ( $data = $this->ipsclass->DB->fetch_row() )
			{
				$data['cp_views']     = $this->ipsclass->do_number_format($data['cp_views']);
				$data['cp_dateadded'] = $this->ipsclass->get_date( $data['cp_dateadded'], 'SHORT' );
				
				if( in_array( $this->ipsclass->member['mgroup'], explode(',',$data['cp_groups'] ) ) )
				{
					$this->output .= $this->ipsclass->compiled_templates['skin_dp23_custom_pages']->dp23_cuspg_one_page($data);   
				}  
			}
		}
		else
		{
			$this->output .= $this->ipsclass->compiled_templates['skin_dp23_custom_pages']->dp23_cuspg_no_page();	
		}
		
		$this->output .= $this->ipsclass->compiled_templates['skin_dp23_custom_pages']->dp23_cuspg_footer(3);   	 
		
		//-----------------------------------------
		// Output all HTML code...   
		//-----------------------------------------	   
		
		$this->nav[] = "<a href='{$this->ipsclass->base_url}autocom=pages'>{$this->ipsclass->lang['dp23_allpages']}</a>";
		$this->out();	
	}
Then open template bit called dp23_cuspg_header in skin_dp23_custom_pages templates group.. Find:
<div class='borderwrap'>
Add above:
{$pagination}

Then open variables and add in the end:
, $pagination

Save and check.
( not tested )
intermedia - profesjonalne rozwiązania Invision Power Board

#33 KaToSpY

  • Użytkownik
  • 5 postów
  • Wersja:n/c

Napisano 15 sierpień 2010 - 23:10

i get this error


Fatal error: Call to a member function build_pagelinks() on a non-object in /home/user/public_html/forums/sources/components_public/pages.php on line 107




line 107 aftar editing contains


  $pagination = $this->ipsclass->adskin->build_pagelinks(array(    'TOTAL_POSS'  => $count['total'],.........
                 


thank's alot for your help

#34 DawPi

    ...a wy Pragnienie™

  • Manager
  • 49506 postów
  • Wersja:IP.Board 3.2.3

Napisano 16 sierpień 2010 - 14:22

I've fixed the code. Try now.
intermedia - profesjonalne rozwiązania Invision Power Board

#35 KaToSpY

  • Użytkownik
  • 5 postów
  • Wersja:n/c

Napisano 17 sierpień 2010 - 05:05

works succesfuly,

thank's alot :D





Użytkownicy przeglądający ten temat: 1

0 użytkowników, 1 gości, 0 anonimowych