/***************************************************************************

    supportware
    Copyright (C) 2001-2008 by c.holzheuer
    c.holzheuer@sourceworx.org

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.

***************************************************************************/


#ifndef SXPAGEADMIN_H
#define SXPAGEADMIN_H

#include <sxpagepager.h>
#include <ddwebsite.h>

/// sxpageadmin: statistik: der hitcounter und der sessioncounter
/**

*/

class sxpageadmin : public sxpage
{

public:

  sxpageadmin( const ddstring& name, ddwebsite* site );
	
	dd_result on_redirect( dditem& item );
	
	
	dd_result admin_pager( dditem& item );
	dd_result admin_pager_kill_msg( dditem& item );
	
 	
	dd_result admin_hits( dditem& item );
  dd_result admin_sessions( dditem& item );  		
  //dd_result admin_postings( dditem& item );  		
  dd_result admin_postings_overview( dditem& item );  		

  dd_result admin_votings_overview( dditem& item );  	
	
	dd_result admin_change_nick( dditem& item );
	
	dd_result admin_halt( dditem& item );		
	//dd_result admin_block( dditem& item );	
	dd_result admin_aliases( dditem& item );	
	dd_result admin_redirects( dditem& item );	
	dd_result admin_block_mail( dditem& item );		
	dd_result admin_block_ip( dditem& item );	
	dd_result admin_block_word( dditem& item );	
	dd_result admin_censor_word( dditem& item );
	
	dd_result admin_linkmap( dditem& item );
	dd_result admin_imagemap( dditem& item );
	dd_result admin_overlay( const ddstring& baselink, const ddstring& databasekey, ddweboverlaylinks& target );
	
	dd_result admin_kill_entry( dditem& item );
	
	dd_result admin_watch_change( dditem& item );
	
	dd_result admin_list_pictures( dditem& item );


	dd_result admin_kill_picture( dditem& item );
	
		
	
	dd_result ajax_link( dditem& item );
	dd_result ajax_block( dditem& item );
	dd_result ajax_test( dditem& item );
	
	dd_result admin_broken_link( dditem& item );
	

	dd_result create_master_index( dditem& item );
	
	void create_faq_group_index		( dditem& item );
	int  create_faq_group_entry		( dditem& item, const ddstring& grpname, int numblocks, int allentries );
	void create_thread_group_index( dditem& item );	
	void create_thread_group_entry( dditem& item, const ddstring& grpname, int blocknum, int numentries );
	
	void create_faq_list_index		( dditem& item );
	int	 create_faq_list_entry		( dditem& item, const ddstring& year, const ddstring& monthno, const ddstring& filename, int blocknum, int numentries  );
	void create_thread_list_index	( dditem& item );
	void create_thread_list_entry	( dditem& item, const ddstring& year, const ddstring& monthno, const ddstring& day, const ddstring& filename );
	
protected:

	ddstringmap					_monthmap;
	ddstringrow					_monthnames;
	vector<int>					_monthlenghts;
	ddmaprow<ddstring>	_groupmap;
	ddmaprow<ddstring>	_groupmapfaqs;
	ddmaprow<ddstring>	_groupmapthreads;
	
	
};

#endif
