Icy Phoenix

     
 


Post new topic  Reply to topic 
Page 1 of 2
Goto page 1, 2  Next
 
Reply with quote Download Post 
Post How To Add New Pages To phpBB XS 
 
Hello,
I need to convert some modules previously made by me for MkPortal. Our old portal before XS.

I studied some php pages in root like forum.php, kb.php, etc. but I didn't undersand very well the procedure to use on XS.

I've seen that the db connections is stored in the variable and class $db, so I need to write
Code: [Download] [Hide]
  1. global $db;  
  2.  


In this modules I need to look into user tables if user filled some field, so, if filled the user will be able to see and ordering form.
Some fields are pre-filled reading the content of user table, and some field are left to be filled by the user.
After some JS field validation the user will be able to send the form to another page that adds a record with some fields (the post data previously filled by the user) in a custom table.

It's very simple but I don't know what I have to implement to have my script to work into XS framework sharing its informations and how to draw the final output, to show the MAIN LINK column.
To send queries to the db I found this methods of class $db:
Code: [Download] [Hide]
  1. $query = $db->sql_query("SELECT * FROM table;");  
  2. while ($row = $db->sql_fetchrow($query)) {  
  3.        //my script  
  4. }  
  5.  


It will be very useful a small guide to make our own modules.

Thanks!
 



 
EradicatorSend private messageVisit poster's website  
Back to topPage bottom
Icy Phoenix is an open source project, you can show your appreciation and support future development by donating to the project.

Support us
 
Reply with quote Download Post 
Post Re: How Make Our Own Modules/pages 
 
here a sample php page using the phpbb functions:

Code: [Download] [Hide]
  1. <?php  
  2. define('IN_PHPBB', true);  
  3. $phpbb_root_path = './';  
  4. include($phpbb_root_path . 'extension.inc');  
  5. include($phpbb_root_path . 'common.'.$phpEx);  
  6.  
  7. //  
  8. // Start session management  
  9. //  
  10. $userdata = session_pagestart($user_ip, PAGE_VIEWMEMBERS);  
  11. init_userprefs($userdata);  
  12. //  
  13. // End session management  
  14. //  
  15.  
  16. $sql = "SELECT column_name FROM " . CONSTANT_WITH_THE_NAME_OF_THE_TABLE . " WHERE column_operator_value";  
  17.  
  18. //the constants with table names are stored in includes/constants.php  
  19. //i.e.: " . POSTS_TABLE . "  
  20.  
  21. if( !($result = $db->sql_query($sql)) )  
  22.  
  23. //if the query fails it shows the error  
  24.  
  25. {  
  26.    message_die(GENERAL_ERROR, 'Could not query posts table', '', __LINE__, __FILE__, $sql);  
  27. }  
  28.  
  29. //otherwise  
  30.  
  31. $result = $db->sql_query($sql);  
  32.  
  33. //YOUR SCRPT ($var = ... $var1 = ...)  
  34.  
  35. //this frees the used and useless resources  
  36.  
  37. $db->sql_freeresult($result);  
  38.  
  39. //  
  40. // Generate page  
  41. //  
  42. $page_title = "Page Title";  
  43. include($phpbb_root_path . 'includes/page_header.'.$phpEx);  
  44.  
  45. //here we set the tpl file name where parsing the page  
  46.  
  47. $template->set_filenames(array(  
  48.     'body' => 'new_page.tpl')  
  49. );  
  50.  
  51. $template->assign_vars(array(  
  52.     'VAR' => $var,  
  53.         'VAR1' => $var1  
  54.     ));  
  55.  
  56. $template->pparse('body');  
  57.  
  58. include($phpbb_root_path . 'includes/page_tail.'.$phpEx);  
  59. ?> 


then we must create the tpl file (new_page.tpl in this case)

Code: [Download] [Hide]
  1. <table width="100%" border="0" class="forumline">  
  2. <tr>  
  3. <td><b>{VAR}</b></td>  
  4. </tr>  
  5. </table> 

 



 
z3d0Send private messageVisit poster's website  
Back to topPage bottom
Reply with quote Download Post 
Post Re: How Make Our Own Modules/pages 
 
Thanks!

And how can I show the XS Main Links menĂ¹?
 



 
EradicatorSend private messageVisit poster's website  
Back to topPage bottom
Reply with quote Download Post 
Post Re: How Make Our Own Modules/pages 
 
Modify the file templates/ca_aphrodite/nav_quick_links.tpl

I have another question about the page, how I can do this page rewriteable ? I mean url friendly ? Like the other pages ... I have rewrite ON.
 



 
LuckySend private message  
Back to topPage bottom
Reply with quote Download Post 
Post Re: How Make Our Own Modules/pages 
 
Lucky wrote: [View Post]
Modify the file templates/ca_aphrodite/nav_quick_links.tpl

I don't mean how to edit quick_links, but how to SHOW the quicklinks on the left of my module.

Thanks!
 



 
EradicatorSend private messageVisit poster's website  
Back to topPage bottom
Reply with quote Download Post 
Post Re: How Make Our Own Modules/Pages 
 
If you had looked into contrib folder... you should have found this: contrib/empty_page/!

This is just a "ready to use" empty page for phpBB XS...

Eradicator wrote: [View Post]
And how can I show the XS Main Links menĂ¹?

Using this in your template:
Code: [Download] [Hide]
  1. <!-- INCLUDE nav_box.tpl --> 


Lucky wrote: [View Post]
I have another question about the page, how I can do this page rewriteable ? I mean url friendly ? Like the other pages ... I have rewrite ON.

What do you mean by this?

You can just assign to the page the name you wish... no need to use a function to rename it!


P.S.: topic moved to Docs.
 




____________
Luca
SEARCH is the quickest way to get support.
Icy Phoenix ColorizeIt - CustomIcy - HON
 
Mighty GorgonSend private messageSend e-mail to userVisit poster's website  
Back to topPage bottom
Reply with quote Download Post 
Post Re: How Make Our Own Modules/Pages 
 
Mighty Gorgon wrote: [View Post]

Lucky wrote: [View Post]
I have another question about the page, how I can do this page rewriteable ? I mean url friendly ? Like the other pages ... I have rewrite ON.

What do you mean by this?

You can just assign to the page the name you wish... no need to use a function to rename it!


P.S.: topic moved to Docs.


i think he means, how he can use rewrite engie (mod rewrite) but im not sure
 




____________

Play Games at GamesCampus!
 
KugeLSichASend private messageVisit poster's website  
Back to topPage bottom
Reply with quote Download Post 
Post Re: How To Add New Pages To phpBB XS 
 
I think he want the new page with the url rewritten... but is completely useless... since you can name the page as you wish, and there is no need to dynamically rename that page.
 




____________
Luca
SEARCH is the quickest way to get support.
Icy Phoenix ColorizeIt - CustomIcy - HON
 
Mighty GorgonSend private messageSend e-mail to userVisit poster's website  
Back to topPage bottom
Reply with quote Download Post 
Post Re: How To Add New Pages To PhpBB XS 
 
Mighty Gorgon wrote: [View Post]
I think he want the new page with the url rewritten... but is completely useless... since you can name the page as you wish, and there is no need to dynamically rename that page.


Yes ! what I mean was to have a new page with the url friendly, for example not www . mywebsite . com/newpage.php but www . mywebsite . com/newpage.html ... but thinking I have understood that it's completely useless !!! as MG typed.

I have understood about the urls friendly (rewritten) that are important for search engine bots only if I have a "complex" address like www. ... .com/newpage.php?mode=23&.....

It's right ?
 



 
LuckySend private message  
Back to topPage bottom
Reply with quote Download Post 
Post Re: How To Add New Pages To PhpBB XS 
 
If the content for empty page must be edited inside the tpl file using html codes ... how can I have the content inside a block like every thing in XS portal ?

I mean something like wellcome block, in fact, the html code appeas inside a block with a bar etc. etc.
 



 
LuckySend private message  
Back to topPage bottom
Reply with quote Download Post 
Post Re: How To Add New Pages To phpBB XS 
 
Use standard HTML... or if you want to use blocks... then create new pages using IM Portal.
 




____________
Luca
SEARCH is the quickest way to get support.
Icy Phoenix ColorizeIt - CustomIcy - HON
 
Mighty GorgonSend private messageSend e-mail to userVisit poster's website  
Back to topPage bottom
Reply with quote Download Post 
Post Re: How To Add New Pages To PhpBB XS 
 
How can I make this page visible only to registered users?
 



 
EradicatorSend private messageVisit poster's website  
Back to topPage bottom
Reply with quote Download Post 
Post Re: How To Add New Pages To PhpBB XS 
 
do you want to hide link or to redirect to login ?
 




____________
*VOLVO CLUB*
 
difusSend private messageVisit poster's website  
Back to topPage bottom
Reply with quote Download Post 
Post Re: How To Add New Pages To PhpBB XS 
 
This was for ipb1.3:
Code: [Download] [Hide]
  1. $email=$userdata->member['email'];  
  2. $nick=$userdata->member['name'];  
  3. $id_utente=$userdata->member['id'];  
  4.  


How can I make the same with XS?


Thanks
 



 
EradicatorSend private messageVisit poster's website  
Back to topPage bottom
Reply with quote Download Post 
Post Re: How To Add New Pages To PhpBB XS 
 
difus wrote: [View Post]
do you want to hide link or to redirect to login ?

I think that the XS' unauthorized access will be good!
I want to allow only usergroup "utenti". The related group_id can be found in phpbb_groups table?

Thanks
 



 
EradicatorSend private messageVisit poster's website  
Back to topPage bottom
Post new topic  Reply to topic  Page 1 of 2
Goto page 1, 2  Next


Display posts from previous:    

HideWas this topic useful?

Link this topic
URL
BBCode
HTML




 
Permissions List
You cannot post new topics
You cannot reply to topics
You cannot edit your posts
You cannot delete your posts
You cannot vote in polls
You cannot attach files
You can download files
You cannot post calendar events


  

 

  cron