Good Guys and Bad Guys...  What are you?
Buy now and get a special price on TotalCalendar 2.4.
Main Menu

Who's Online
Welcome, Anonymous
Nickname
Password
(Register)
Membership:
Latest: LouiseGog
New Today: 0
New Yesterday: 0
Overall: 30818

People Online:
Visitors: 1
Members: 0
Total: 1

 



[ Downloads Main | Add Download | New | Popular | Top Rated ]

 
Category: Main/Other/PHP Classes/Tools


Sort Downloads by: Title (A\D) Date (A\D) Rating (A\D) Popularity (A\D)
Resources currently sorted by: Date (New Downloads Listed First)


  CSVimporter Class 
Description:
This PHP class will take the data from a csv file and import it into a MySQL table.  It is very useful if you have data that you manage/modify in a spreadsheet program like Excel and need to import the data into a MySQL database table.  The class will allow you to specify field names manually, or use field names from the csv file in the first row.  This .zip package includes an example.php file that shows how to use the class. 
Version: Filesize: 3.91 Kb
Added on: 25-May-2005 Downloads: 1960 Rating: 8 (1 Vote)
HomePage | Rate Resource | Details


  CMSconverter Class 
Description:

This class will take any normal HTML code and format it for a Content Management System (CMS) to use for a module.  This is a great tool for helping to create modules for PHP-Nuke, PostNuke, and CPGNuke.  It will take code that you write and format it to be compatible with these CMS systems.  It will even automatically detect which CMS you are using.  The .zip package includes an example.php file showing how to use the class.  This is the same class that allows TotalCalendar to be compatible with all 3 CMS systems mentioned previously.  Here is a breif scenerio of what it is used for:

If you are building a normal PHP script (not for a CMS), you will have multiple files in a single directory.  Let's assume we want 2 files for our new script.  File #1 (index.php) will have a link to file #2 (next.php).  So we create the index.php file with the following code:


<?php

$output = "<a href="next.php">Go to next page...</a>";
echo $output;

?>


All this file does is display a link that says "Go to next page..." that points to the next.php file.  You can put anything you want inside the next.php file and it will be displayed after the link is clicked.

Now, in order to create that same link above when creating a module (we'll call our module "MyMod" in this example) for a CMS, your code would have to look like this for PHP-Nuke and PostNuke:


<?php

$output = "<a href="modules.php?name=MyMod&file=next">Go to next page...</a>";
echo $output;

?>


And it would look like this for CPGNuke:


<?php

$output = "<a href="index.php?name=MyMod&file=next">Go to next page...</a>";
echo $output;

?>


Formatting your urls for a CMS can get pretty long and tedious.  The CMSconverter class will detect the CMS automatically and then automatically convert the urls for hyperlinks.  However, hyperlinks are not the only things that need to have special formatting involved for usage in a CMS.  A little more difficult process for CMS modules is using forms.  We'll continue to use the example above with the two files to show how this will help you build forms in your module. 

Let's say you want an input form in the index.php file and the next.php file will accept the data and validate it.  In a normal (non-CMS) script the code for this form in the index.php file would look something like this:


<?php

$output = "<form method="post" action="next.php">
Input: <input name="myInput" value="input value" size="20"><br><br>
<input type="submit" name="submitButton" value="Submit"> <input type="submit" name="submitButton" value="Cancel">
</form>";
echo $output;

?>


This will create a very simple input form and the data will be passed to the next.php file.  Now, to use the same form in a CMS module (our module is called "MyMod"), you would need to make it look something like this for PHP-Nuke and PostNuke:


<?php

$output = "<form method="post" action="modules.php">
<input type="hidden" name="name" value="MyMod">
<input type="hidden" name="file" value="next">
Input: <input name="myInput" value="input value" size="20"><br><br>
<input type="submit" name="submitButton" value="Submit"> <input type="submit" name="submitButton" value="Cancel">
</form>";
echo $output;

?>


And it would look like this for CPGNuke:


<?php

$output = "<form method="post" action="index.php">
<input type="hidden" name="name" value="MyMod">
<input type="hidden" name="file" value="next">
Input: <input name="myInput" value="input value" size="20"><br><br>
<input type="submit" name="submitButton" value="Submit"> <input type="submit" name="submitButton" value="Cancel">
</form>";
echo $output;

?>


As you can see from the above examples, adding the extra hidden values and url string values can be quite a job when your module will contain lots of content.  The CMSconverter class will convert the links and forms into ones that will be compatible with your CMS for your module.  Here are a coupld examples:

Ex:  Link formatting
---------------------------------------------------------------------------------------
It will turn a link like this:

<a href="next.php?action=my_action&var=val">My Url Link</a>

Into a CMS formatted link like this:

<a href="modules.php?name=MyMod&file=next&action=my_action&var=val">My Url Link</a>

OR

<a href="index.php?name=MyMod&file=next&action=my_action&var=val">My Url Link</a>

Ex:  Form formatting
---------------------------------------------------------------------------------------
It will turn form code like this:

<form method="post" action="next.php">
Input: <input name="myInput" value="input value" size="20"><br><br>
<input type="submit" name="submitButton" value="Submit"> <input type="submit" name="submitButton" value="Cancel">
</form>

Into CMS formatted code like this:

<form method="post" action="modules.php?name=MyMod&file=next">
<input type="hidden" name="name" value="MyMod" />
<input type="hidden" name="file" value="next" />
Input: <input name="myInput" value="input value" size="20"><br><br>
<input type="submit" name="submitButton" value="Submit"> <input type="submit" name="submitButton" value="Cancel">
</form>

OR

<form method="post" action="index.php?name=MyMod&file=next">
<input type="hidden" name="name" value="MyMod" />
<input type="hidden" name="file" value="next" />
Input: <input name="myInput" value="input value" size="20"><br><br>
<input type="submit" name="submitButton" value="Submit"> <input type="submit" name="submitButton" value="Cancel">
</form>


The great part about this class is that it will automatically detect the CMS you are using and properly format the HTML code for it.  As stated above, this class code is what allows TotalCalendar to be compatible with the 3 CMS systems above and allows it to work as a standalone application (without a CMS) all at the same time.

Version: Filesize: 3.79 Kb
Added on: 25-May-2005 Downloads: 1882
HomePage | Rate Resource | Details


Survey
What support system do you like better?

Help Forums
TotalSupport Module



Results
Polls

Votes 142

SweetPHP Lottery
There are currently no lotteries in progress...


Copyright 2018 SweetPHP.com