Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Modules
Author Message
Bigboy177
Worker
Worker



Joined: Jul 07, 2004
Posts: 192

PostPosted: Wed Jul 21, 2004 2:38 pm Reply with quote

I want to make my own module... A module which will only display one page of data... How should I start such module... Can someone give me some advice how to make a module...
 
View user's profile Send private message
sixonetonoffun
Spouse Contemplates Divorce



Joined: Jan 02, 2003
Posts: 2496

PostPosted: Wed Jul 21, 2004 2:58 pm Reply with quote

Just a rough start here
modules/Your_Module_Name/index.php
<?php
if (!eregi("modules.php", $_SERVER['SCRIPT_NAME'])) {
die ("You can't access this file directly...");
}

require_once("mainfile.php");
$module_name = basename(dirname(__FILE__));
include("header.php");
$index = 0;
OpenTable();
Your content here
CloseTable();
include("footer.php");
?>

_________________
[b][size=5]openSUSE 11.4-x86 | Linux 2.6.37.1-1.2desktop i686 | KDE: 4.6.41>=4.7 | XFCE 4.8 | AMD Athlon(tm) XP 3000+ | MSI K7N2 Delta-L | 3GB Black Diamond DDR
| GeForce 6200@433Mhz 512MB | Xorg 1.9.3 | NVIDIA 270.30[/size:2b8 
View user's profile Send private message
Bigboy177







PostPosted: Wed Jul 21, 2004 6:07 pm Reply with quote

Thanks for your help...
I've got another quetions... I'm trying to read the current Date... How can I do it...
I wrote something like this:
Code:


OpenTable();
   
    echo "<center><font class=\"option\">Harmonogram Premier</font></center><br><br>"
   ."<table width=\"100%\" cellpadding=\"4\" cellspacing=\"0\" border=\"0\">"
   ."<tr><td bgcolor=\"$bgcolor2\">Styczeń</td></tr><tr><td>";
    $today = getdate();
    $eday = $today[mday];
    $emonth = $today[mon];
    $result = $db->sql_query("SELECT yid, mid, did, content FROM ".$prefix."_ephem WHERE mid='$emonth' $querylang");
    while ($row = $db->sql_fetchrow($result)) {
   $yid = intval($row['yid']);
   $mid = intval($row['mid']);
   $did = intval($row['did']);
   $econtent = stripslashes($row['content']);
   
   echo"<strong><big>&middot;</big></strong>$yid.$mid.$did<br>";
   echo"<strong><big>&middot;</big></strong>$econtent<br>";
}   
    echo "</td></tr></table>";
    CloseTable();

include("footer.php");

But it doesn't work... When I set manualy to read mid='6' it works but I want to read data from the current month it doesn't work...
And aslo the second question...
this is current day $eday = $today[mday];
this is current month $emonth = $today[mon];
but how can I read current year...
maybe like this : $eyear = $today[year];

Please help...
 
sixonetonoffun







PostPosted: Thu Jul 22, 2004 3:04 am Reply with quote

Looks good just add $db to your missing Globals line and yes $eyear = $today[year]; should work fine in the getdate()
 
Bigboy177







PostPosted: Thu Jul 22, 2004 12:54 pm Reply with quote

Thanks a lot for your help... It's working like a charm... I'll probrably have more questions... But now it's all ok... Smile Thanks Again... Cheers
 
Bigboy177







PostPosted: Thu Jul 22, 2004 3:25 pm Reply with quote

I have written my Module... I thinks I'm done... Now I've got a question... I want my module to open from a link in a Main Page... But I don't want it to open on the whole page just as popup window. And I would like to set size of that Popup window...
How can I do it... ?? Can you help @sixonetonoffun... Smile
 
Bigboy177







PostPosted: Fri Jul 23, 2004 5:07 am Reply with quote

Is it even possible to have open a Module in a popup... ??
 
Bigboy177







PostPosted: Fri Jul 23, 2004 6:35 pm Reply with quote

I would like to have pages opened by links in my modeule how can I do it without writing a new file... I want for example...

I enter my module... And I see...

Todays Events...
1. Bla bla bla
2. Working
3. Playing

Than Under that events I see links:

[Tomorrows Events] [Yesterdays Events]

And I want to this links to open a new page... but I don't want to write a second and third new file... Can I use some goto function or something like that... Please help...
 
sixonetonoffun







PostPosted: Fri Jul 23, 2004 10:34 pm Reply with quote

You can make each page in the same file look at the simpler modules lije Encyclopedia as an example to work from. Its pretty simple to follow.
 
Bigboy177







PostPosted: Sat Jul 24, 2004 4:29 am Reply with quote

I've figured it out... After posting... Wink Thanks for help... My module is getting better and better... Smile And I understand PHP more and more... Smile
 
brentnhunter
Client



Joined: Sep 10, 2004
Posts: 166

PostPosted: Sun Oct 17, 2004 12:51 pm Reply with quote

It looks like the original script in the beginning of this message thread shows how to create a module that can't be called directly. What about a module that can be called directly? I would like to create an About This Site module, so when pople click on the module link, it shows them a page of information, possibly with links to follow-on pages.

And how do I create the follow-on pages?

Thanks for any help anyone can provide!

Brent Hunter
http://www.EarthCommCenter.com
 
View user's profile Send private message
ecvej
Hangin' Around



Joined: Oct 10, 2004
Posts: 45
Location: Northampton, UK

PostPosted: Mon Oct 18, 2004 11:48 am Reply with quote

brentnhunter the code above CAN be called directly from your module block or whereever. Name it index.php and put it in a folder called About_This_Site in your modules folder. Then edit the index.php page, putting the links in it as I showed you in the other thread to your follow on pages.

To make the follow on pages, use them same base code as above and save it in the same module folder. eg save it as index2.php

The code below, inserted into your index page will make a link to index2.php

Code:
echo "<a href="modules.php?name=About_This_Site%20&%20file=index.php2">Page 2</a>";


Get it?


Last edited by ecvej on Wed Oct 20, 2004 12:03 am; edited 1 time in total 
View user's profile Send private message
brentnhunter







PostPosted: Tue Oct 19, 2004 11:35 pm Reply with quote

Yes, I previously figured it out but thank you very much for your reply!

Brent
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Modules

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©