1
ninjturtles
How can I make Custom Pages in Xoops?
  • 2007/12/8 22:31

  • ninjturtles

  • Just popping in

  • Posts: 5

  • Since: 2006/3/24


Hi,

Does anyone know how I can make custom pages in XOOPS besides using the modules. I need to make a lot of them quick (so I'm scripting something that'll spit out all the code for the webpages that I need, I just need the basic code structure).

How can I create a custom page that will have my content and also maintain the same blocks/themes of the website. I found a tutorial herehttp://www.xoopstuner.com/xoops223a/modules/AMS/article.php?storyid=11 that works great, but it's for the root folder only. Please bear with me here since I'm relatively unfamiliar with php.

How can I get it to work, say if my custom page is here like so...

root/tutorials/customPage

The tutorial works perfectly when customPage is in the root folder, and all I want is for it to also work when the folder setup is like the one show above.

Thanks in advance.

2
smart2
Re: How can I make Custom Pages in Xoops?
  • 2007/12/9 1:27

  • smart2

  • Not too shy to talk

  • Posts: 129

  • Since: 2007/1/19


You need to change the includes path

include 'mainfile.php';

becomes

include '../mainfile.php';

And so on

3
Northern
Re: How can I make Custom Pages in Xoops?
  • 2007/12/9 4:18

  • Northern

  • Just can't stay away

  • Posts: 420

  • Since: 2004/12/26


you can place this just about any place you like and it will work.


<?php 
if (file_exists("mainfile.php")) { 
    include(
"mainfile.php"); 

elseif(
file_exists("../mainfile.php")) { 
    include(
"../mainfile.php"); 

else { 
    include(
"../../mainfile.php"); 

include(
XOOPS_ROOT_PATH "/header.php"); 
$xoopsTpl->assign('xoops_showrblock'0); // 1 display right blocks 
$xoopsTpl->assign('xoops_showlblock'0); // 1 display right blocks 
/////// 
echo "Your code"
/////// 
include(XOOPS_ROOT_PATH "/footer.php"); 
?>



Marc

4
script_fu
Re: How can I make Custom Pages in Xoops?

Yep just wrap it up... Works very well...

5
Northern
Re: How can I make Custom Pages in Xoops?
  • 2007/12/9 5:01

  • Northern

  • Just can't stay away

  • Posts: 420

  • Since: 2004/12/26


It just works so good


http://helpxoops.info/test.php
http://helpxoops.info/testing/index.php
http://helpxoops.info/testing/test2/index.php

6
script_fu
Re: How can I make Custom Pages in Xoops?

A lil typo in the explanation of the code.

Should say

$xoopsTpl->assign('xoops_showrblock', 0); // 1 display right blocks
$xoopsTpl->assign('xoops_showlblock', 0); // 1 display left blocks

Just make the 0 a 1 and you have side blocks. Northern is right. This is the defacto standard for adding content without the help of a module. The only drawback is it can't be searched by XOOPS because the content is not in the database. Also you will need to update the pages manually one-by-one if you need to change them in the future.

Give this module a try...

Happy search

It uses google search and should pick up the wrapped custom pages very well. As long as you have displayed the links to the custom page so google can find them.

7
Northern
Re: How can I make Custom Pages in Xoops?
  • 2007/12/9 6:18

  • Northern

  • Just can't stay away

  • Posts: 420

  • Since: 2004/12/26


Up dated code.

thanks Billy for pointing out my typo.


<?php  
if (file_exists("mainfile.php")) {  
    include(
"mainfile.php");  
}  
elseif(
file_exists("../mainfile.php")) {  
    include(
"../mainfile.php");  
}  
else {  
    include(
"../../mainfile.php");  
}  
include(
XOOPS_ROOT_PATH "/header.php");  
$xoopsTpl->assign('xoops_showrblock'1); // 1 to display right blocks, 0 to hide  
$xoopsTpl->assign('xoops_showlblock'1); // 1 to display left blocks , 0 to hide 
///////  
echo "Your code";  
///////  
include(XOOPS_ROOT_PATH "/footer.php");  
?>

8
script_fu
Re: How can I make Custom Pages in Xoops?

Yep small little issue Marc...

Np

9
ninjturtles
Re: How can I make Custom Pages in Xoops?
  • 2007/12/10 5:55

  • ninjturtles

  • Just popping in

  • Posts: 5

  • Since: 2006/3/24


Thanks a bunch to the three of you guys.

It works perfectly Northern, thanks for the script.

Jason Lin

10
mesol
Re: How can I make Custom Pages in Xoops?
  • 2007/12/10 10:48

  • mesol

  • Not too shy to talk

  • Posts: 168

  • Since: 2006/4/19


and also here, simple tutorial using .htaccess -http://www.ewonline.net/xoops-friendlyurls.html

Login

Who's Online

218 user(s) are online (105 user(s) are browsing Support Forums)


Members: 0


Guests: 218


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Mar 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits