PHP Web Host - Quality Web Hosting For All PHP Applications Just Great Software
  Login or Register
 • Home • Downloads • Your Account • Forums • 

View next topic
View previous topic


Google
 
Web RavenPHPScripts (This Site)
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.
Author Message
tonydg
Hangin' Around


Joined: Jul 16, 2003
Posts: 26

PostPosted: Tue Aug 12, 2003 10:30 pm Reply with quote Back to top

Raven,

I.m still trying to get his table.pho to execute one set of fungtions if the forums module is callled and another set if anything else is called.

Problem is I must have a syntax error in that it doesen't call the second set of functions after the "else" in line 25.

Code:
?php
if ($module == $forums){

function OpenTable() {
   
    echo "<table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"0\" ><tr><td class=>\n";
    echo "<table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"8\" ><tr><td>\n";
}

function CloseTable() {
    echo "</td></tr></table></td></tr></table>\n";
}

function OpenTable2() {
   
    echo "<table border=\"0\" cellspacing=\"1\" cellpadding=\"0\" align=\"center\"><tr><td class=nothing>\n";
    echo "<table border=\"0\" cellspacing=\"1\" cellpadding=\"8\" ><tr><td>\n";
}

function CloseTable2() {
    echo "</td></tr></table></td></tr></table>\n";
end;
}

} else {

function OpenTable() {
    echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\"><tr>
    <td width=\"15\" height=\"15\"><img src=\"themes/XtremeDream/images/up-left2.gif\" alt=\"\" border=\"0\"></td>
    <td background=\"themes/XtremeDream/images/up2.gif\" align=\"center\" width=\"100%\" height=\"15\">&nbsp;</td>
    <td><img src=\"themes/XtremeDream/images/up-right2.gif\" width=\"15\" height=\"15\" alt=\"\" border=\"0\"></td></tr>
    <tr>
    <td background=\"themes/XtremeDream/images/left2.gif\" width=\"15\">&nbsp;</td>
    <td bgcolor=\"fffcd9\" width=\"100%\">";
}

function OpenTable2() {

    echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\"><tr>
    <td width=\"15\" height=\"15\"><img src=\"themes/XtremeDream/images/up-left2.gif\" alt=\"\" border=\"0\" width=\"100%\"><tr>
    <td background=\"themes/XtremeDream/images/up2.gif\" align=\"center\" height=\"15\">&nbsp;</td>
    <td><img src=\"themes/XtremeDream/images/up-right2.gif\" width=\"15\" height=\"15\" alt=\"\" border=\"0\"></td></tr>
    <tr>
    <td background=\"themes/XtremeDream/images/left2.gif\" width=\"15\">&nbsp;</td>
    <td bgcolor=\"fffcd9\">";
}
   
function CloseTable() {
    echo "</td>
    <td background=\"themes/XtremeDream/images/right2.gif\">&nbsp;</td></tr>
    <tr>
    <td width=\"15\" height=\"15\"><img src=\"themes/XtremeDream/images/down-left2.gif\" alt=\"\" border=\"0\"></td>
    <td background=\"themes/XtremeDream/images/down2.gif\" align=\"center\" height=\"15\">&nbsp;</td>
    <td><img src=\"themes/XtremeDream/images/down-right2.gif\" width=\"15\" height=\"15\" alt=\"\" border=\"0\"></td></tr>
    </td></tr></table>
    <br>";
}

function CloseTable2() {
    echo "</td>
    <td background=\"themes/XtremeDream/images/right2.gif\">&nbsp;</td></tr>
    <tr>
    <td width=\"15\" height=\"15\"><img src=\"themes/XtremeDream/images/down-left2.gif\" alt=\"\" border=\"0\"></td>
    <td background=\"themes/XtremeDream/images/down2.gif\" align=\"center\" height=\"15\">&nbsp;</td>
    <td><img src=\"themes/XtremeDream/images/down-right2.gif\" width=\"15\" height=\"15\" alt=\"\" border=\"0\"></td></tr>
    </td></tr></table>
    <br>";
}
}
?>


all teh table functions work great separately but I can't get the if....else code to work.


Thanks

Tony
View user's profile Send private message
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 16987
Location: Kansas

PostPosted: Tue Aug 12, 2003 10:49 pm Reply with quote Back to top

In line 22 you have

end;

php doesn't like that Wink
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
tonydg
Hangin' Around


Joined: Jul 16, 2003
Posts: 26

PostPosted: Tue Aug 12, 2003 10:56 pm Reply with quote Back to top

All I need to do is remove
Code:
end;


and have it read
Code:
function CloseTable2() {
    echo "</td></tr></table></td></tr></table>\n";

}

} else {


and the if else is OK?

Also I wasn't sure about
Code:
if ($module == $forums){

function OpenTable() {


Is that syntax OK?

Thanks


TonyDG
View user's profile Send private message
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 16987
Location: Kansas

PostPosted: Tue Aug 12, 2003 10:58 pm Reply with quote Back to top

Tony, I am not testing this code. I am just trying to eyeball it when you say you have a specific error. Syntax wise those look ok.
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
tonydg
Hangin' Around


Joined: Jul 16, 2003
Posts: 26

PostPosted: Tue Aug 12, 2003 11:36 pm Reply with quote Back to top

Raven,

This code is my first set of function - no borders/ no /backgrounds
works perfect as a standalone code.

Code:
function OpenTable() {
   
    echo "<table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"0\" ><tr><td class=>\n";
    echo "<table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"8\" ><tr><td>\n";
}

function CloseTable() {
    echo "</td></tr></table></td></tr></table>\n";
}

function OpenTable2() {
   
    echo "<table border=\"0\" cellspacing=\"1\" cellpadding=\"0\" align=\"center\"><tr><td class=nothing>\n";
    echo "<table border=\"0\" cellspacing=\"1\" cellpadding=\"8\" ><tr><td>\n";
}

function CloseTable2() {
    echo "</td></tr></table></td></tr></table>\n";


My second set of function also work perfect - makes background color and borders.
Code:
function OpenTable() {
    echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\"><tr>
    <td width=\"15\" height=\"15\"><img src=\"themes/XtremeDream/images/up-left2.gif\" alt=\"\" border=\"0\"></td>
    <td background=\"themes/XtremeDream/images/up2.gif\" align=\"center\" width=\"100%\" height=\"15\">&nbsp;</td>
    <td><img src=\"themes/XtremeDream/images/up-right2.gif\" width=\"15\" height=\"15\" alt=\"\" border=\"0\"></td></tr>
    <tr>
    <td background=\"themes/XtremeDream/images/left2.gif\" width=\"15\">&nbsp;</td>
    <td bgcolor=\"fffcd9\" width=\"100%\">";
}

function OpenTable2() {

    echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\"><tr>
    <td width=\"15\" height=\"15\"><img src=\"themes/XtremeDream/images/up-left2.gif\" alt=\"\" border=\"0\" width=\"100%\"><tr>
    <td background=\"themes/XtremeDream/images/up2.gif\" align=\"center\" height=\"15\">&nbsp;</td>
    <td><img src=\"themes/XtremeDream/images/up-right2.gif\" width=\"15\" height=\"15\" alt=\"\" border=\"0\"></td></tr>
    <tr>
    <td background=\"themes/XtremeDream/images/left2.gif\" width=\"15\">&nbsp;</td>
    <td bgcolor=\"fffcd9\">";
}
   
function CloseTable() {
    echo "</td>
    <td background=\"themes/XtremeDream/images/right2.gif\">&nbsp;</td></tr>
    <tr>
    <td width=\"15\" height=\"15\"><img src=\"themes/XtremeDream/images/down-left2.gif\" alt=\"\" border=\"0\"></td>
    <td background=\"themes/XtremeDream/images/down2.gif\" align=\"center\" height=\"15\">&nbsp;</td>
    <td><img src=\"themes/XtremeDream/images/down-right2.gif\" width=\"15\" height=\"15\" alt=\"\" border=\"0\"></td></tr>
    </td></tr></table>
    <br>";
}

function CloseTable2() {
    echo "</td>
    <td background=\"themes/XtremeDream/images/right2.gif\">&nbsp;</td></tr>
    <tr>
    <td width=\"15\" height=\"15\"><img src=\"themes/XtremeDream/images/down-left2.gif\" alt=\"\" border=\"0\"></td>
    <td background=\"themes/XtremeDream/images/down2.gif\" align=\"center\" height=\"15\">&nbsp;</td>
    <td><img src=\"themes/XtremeDream/images/down-right2.gif\" width=\"15\" height=\"15\" alt=\"\" border=\"0\"></td></tr>
    </td></tr></table>
    <br>";


I still dont have the if else right - previous post never calls second set of functios.

I need to put a lineof code that handles the
Code:
 If the module is forums.php ---run the first set of functions taht follows


Then I need to inset code between teh fisrt and second funtiions that funtions to:

Code:
For anything else run this second set of functions



Then all I need is the right ending code after teh second set of functions.
All I need is the if /else coding and the end.


Thanks

Tony
View user's profile Send private message
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 16987
Location: Kansas

PostPosted: Wed Aug 13, 2003 7:03 am Reply with quote Back to top

How about some code like
Code:
if (!eregi("forums.php", $_SERVER['PHP_SELF'])) {
//run first routine
}
else {
//run second routine
}
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
tonydg
Hangin' Around


Joined: Jul 16, 2003
Posts: 26

PostPosted: Wed Aug 13, 2003 8:46 am Reply with quote Back to top

Raven,

I tried to imsert the code - still won't run second set of routines.

Code:
<?php
if (!eregi("forums.php", $_SERVER['PHP_SELF'])) {

function OpenTable() {
   
    echo "<table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"0\" ><tr><td class=>\n";
    echo "<table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"8\" ><tr><td>\n";
}

function CloseTable() {
    echo "</td></tr></table></td></tr></table>\n";
}

function OpenTable2() {
   
    echo "<table border=\"0\" cellspacing=\"1\" cellpadding=\"0\" align=\"center\"><tr><td class=nothing>\n";
    echo "<table border=\"0\" cellspacing=\"1\" cellpadding=\"8\" ><tr><td>\n";
}

function CloseTable2() {
    echo "</td></tr></table></td></tr></table>\n";
}
}
else {

function OpenTable() {
    echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\"><tr>
    <td width=\"15\" height=\"15\"><img src=\"themes/XtremeDream/images/up-left2.gif\" alt=\"\" border=\"0\"></td>
    <td background=\"themes/XtremeDream/images/up2.gif\" align=\"center\" width=\"100%\" height=\"15\">&</td>
    <td><img src=\"themes/XtremeDream/images/up-right2.gif\" width=\"15\" height=\"15\" alt=\"\" border=\"0\"></td></tr>
    <tr>
    <td background=\"themes/XtremeDream/images/left2.gif\" width=\"15\">&</td>
    <td bgcolor=\"fffcd9\" width=\"100%\">";
}

function OpenTable2() {

    echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\"><tr>
    <td width=\"15\" height=\"15\"><img src=\"themes/XtremeDream/images/up-left2.gif\" alt=\"\" border=\"0\" width=\"100%\"><tr>
    <td background=\"themes/XtremeDream/images/up2.gif\" align=\"center\" height=\"15\">&</td>
    <td><img src=\"themes/XtremeDream/images/up-right2.gif\" width=\"15\" height=\"15\" alt=\"\" border=\"0\"></td></tr>
    <tr>
    <td background=\"themes/XtremeDream/images/left2.gif\" width=\"15\">&</td>
    <td bgcolor=\"fffcd9\">";
}
   
function CloseTable() {
    echo "</td>
    <td background=\"themes/XtremeDream/images/right2.gif\">&</td></tr>
    <tr>
    <td width=\"15\" height=\"15\"><img src=\"themes/XtremeDream/images/down-left2.gif\" alt=\"\" border=\"0\"></td>
    <td background=\"themes/XtremeDream/images/down2.gif\" align=\"center\" height=\"15\">&</td>
    <td><img src=\"themes/XtremeDream/images/down-right2.gif\" width=\"15\" height=\"15\" alt=\"\" border=\"0\"></td></tr>
    </td></tr></table>
    <br>";
}

function CloseTable2() {
    echo "</td>
    <td background=\"themes/XtremeDream/images/right2.gif\">&</td></tr>
    <tr>
    <td width=\"15\" height=\"15\"><img src=\"themes/XtremeDream/images/down-left2.gif\" alt=\"\" border=\"0\"></td>
    <td background=\"themes/XtremeDream/images/down2.gif\" align=\"center\" height=\"15\">&</td>
    <td><img src=\"themes/XtremeDream/images/down-right2.gif\" width=\"15\" height=\"15\" alt=\"\" border=\"0\"></td></tr>
    </td></tr></table>
    <br>";
}
}
?>



Did I create a syntax error putting the code in?

Tony
View user's profile Send private message
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 16987
Location: Kansas

PostPosted: Wed Aug 13, 2003 10:10 am Reply with quote Back to top

Remove the ! for routine 1 to be used. I'm still checking the routine.
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
tonydg
Hangin' Around


Joined: Jul 16, 2003
Posts: 26

PostPosted: Wed Aug 13, 2003 10:21 am Reply with quote Back to top

Raven,

Like this?
Code:
if (eregi("forums.php", $_SERVER['PHP_SELF'])) {


TDG

Be gentle still a php newbie
View user's profile Send private message
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 16987
Location: Kansas

PostPosted: Wed Aug 13, 2003 11:21 am Reply with quote Back to top

Yes. I still don't know id that will work, but it will be syntactically correct whereas the other one wasn't.
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
tonydg
Hangin' Around


Joined: Jul 16, 2003
Posts: 26

PostPosted: Wed Aug 13, 2003 11:36 am Reply with quote Back to top

Raven

The string without the"!" skips over the first routine and just runs the second.

Could it be possible to use something like

Code:
if (eregi($module_name = Forums, $_SERVER['PHP_SELF'])) {


This is frustrating as each routine works perfectly independently - just cant make if/else work.


TDG
View user's profile Send private message
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 16987
Location: Kansas

PostPosted: Wed Aug 13, 2003 12:00 pm Reply with quote Back to top

Wait a minute! What folder is this file in?
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
tonydg
Hangin' Around


Joined: Jul 16, 2003
Posts: 26

PostPosted: Wed Aug 13, 2003 12:11 pm Reply with quote Back to top

File is in my themes folder. We took the Mtechnik Ultra theme and created a block.html and tables.php file to give us independent control over images and borders.

File location is : site/themes/XtremeDream/tables.php

TDG
View user's profile Send private message
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 16987
Location: Kansas

PostPosted: Wed Aug 13, 2003 12:13 pm Reply with quote Back to top

That matters! So, now tell me, what is the condition that calls routine 1, as opposed to routine 2? When do I call routine 1?
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
tonydg
Hangin' Around


Joined: Jul 16, 2003
Posts: 26

PostPosted: Wed Aug 13, 2003 12:23 pm Reply with quote Back to top

If the user clicks "Forums" the program should run the first routine - so that when the Forums page is viewed it has no background color or border.

If any other module is selected it should run routine 2 - which puts a border and background in.

Taking the "!" out makes the tables.php run only the second routine.
In IE the borders and background routine totally scsrews up the Forums page. In Netscape and Mozilla it just corrupts the Forums right and bottom border.

That is why we decided to do an if/then funtion - if Forums is clicked there will be no border and background on the page. If any othe rmodule is clicked there will be a border and background which is mandatory for this theme to work tight.

If you look at the site you can see routine 2 in action



Only registered users can see links on this board!
Get registered or login to the forums!


then go to forums and see the problem (especially in IE)!

Thanks

TDG
View user's profile Send private message
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 16987
Location: Kansas

PostPosted: Wed Aug 13, 2003 12:30 pm Reply with quote Back to top

Try this. In the Forums hyperlink, add a variable pair, r1 (for routine1). So the link will look like this:
Code:
http://multimodalmedia.com/site/modules.php?name=Forums&r1=1

Then, change your IF test to
Code:
if ($_GET['r1']) {
routine 1
}
else {
routine 2
}
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
tonydg
Hangin' Around


Joined: Jul 16, 2003
Posts: 26

PostPosted: Wed Aug 13, 2003 12:41 pm Reply with quote Back to top

Do you mean:

#!

Code:
<?php
if ($_GET['r1']) {

function OpenTable() {
   


or


#2

Code:
<?php
if ($_GET['r1']) {
routine 1
}

function OpenTable() {


Also excuse my newness - wher do I go to change the Forums hyperlink?


Thanks

TDG
View user's profile Send private message
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 16987
Location: Kansas

PostPosted: Wed Aug 13, 2003 12:54 pm Reply with quote Back to top

#1. And instead of altering the hyperlink, add this line to the Forums/index.php somewhere near the top, like before define('IN_PHPBB', true);

$r1 = 1;

Then, make that $_GET line this:

<?php
if ($r1) {

function OpenTable() {


I have a conference call I have to attend so I'll be back later.
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
tonydg
Hangin' Around


Joined: Jul 16, 2003
Posts: 26

PostPosted: Wed Aug 13, 2003 1:13 pm Reply with quote Back to top

Must have done it wron - still getting routine 2 only, even if you click forums.

Here is modified forums index.php

Code:
if (!eregi("modules.php", $_SERVER['PHP_SELF']))
    {
   die ("You can't access this file directly...");
    }
if ($popup != "1")
    {
   $module_name = basename(dirname(__FILE__));
   require("modules/".$module_name."/nukebb.php");
    }
    else
    {
   $phpbb_root_path = 'modules/Forums/';
    }
$r1 = 1;
define('IN_PHPBB', true);
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);



here is modified start of tables.php

Code:
?php
if ($r1) {

function OpenTable() {

echo "<table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"0\" ><tr><td class=>\n";
echo "<table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"8\" ><tr><td>\n";
}

function CloseTable() {
echo "</td></tr></table></td></tr></table>\n";
}

function OpenTable2() {
   
echo "<table border=\"0\" cellspacing=\"1\" cellpadding=\"0\" align=\"center\"><tr><td class=nothing>\n";
echo "<table border=\"0\" cellspacing=\"1\" cellpadding=\"8\" ><tr><td>\n";
            }

function CloseTable2() {
echo "</td></tr></table></td></tr></table>\n";
}

}
else {

function OpenTable() {



where did I go wrong?

TDG
View user's profile Send private message
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 16987
Location: Kansas

PostPosted: Wed Aug 13, 2003 2:06 pm Reply with quote Back to top

That just means that $r1 isn't getting recognized [yet]. Can I just have ftp access to your site? it would really make this a whole lot easier. i will then be changing code until I get it working. Send me, in a PM, your ftp url, id, and password.
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
tonydg
Hangin' Around


Joined: Jul 16, 2003
Posts: 26

PostPosted: Wed Aug 13, 2003 2:33 pm Reply with quote Back to top

Info PM'd.

Thanks

TDG
View user's profile Send private message
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 16987
Location: Kansas

PostPosted: Wed Aug 13, 2003 3:16 pm Reply with quote Back to top

Your host does not allow .htaccess files Mad

Can you get them to turn register_globals ON?
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 16987
Location: Kansas

PostPosted: Wed Aug 13, 2003 3:28 pm Reply with quote Back to top

Try it now. I think I got it. And if so you don't need to contact your host!
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
tonydg
Hangin' Around


Joined: Jul 16, 2003
Posts: 26

PostPosted: Wed Aug 13, 2003 3:31 pm Reply with quote Back to top

Raven,

They just turned it on. And rebooted the server.
probably kicked you from FTP

Should be able to get on now.

Tony
View user's profile Send private message
tonydg
Hangin' Around


Joined: Jul 16, 2003
Posts: 26

PostPosted: Wed Aug 13, 2003 3:44 pm Reply with quote Back to top

Raven - It looks like its working great!!!!!! Very Happy

Checked in IE, Netscape and Mozilla - all good so far.

You are the best!!!!


TonyDG
View user's profile Send private message
Display posts from previous:       
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.

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
Forums ©
 

All logos and trademarks in this site are property of their respective owner.
The comments are property of their posters, all the rest © 2002-2011 by Raven

You can syndicate our news using the file xml

CSE HTML Validator Helped Clean up This Page! [Valid RSS] valid RSS 2.0 Valid robots.txt Stop Spam Harvesters, Join Project Honey Pot

Website engines core code is © copyright by PHP-Nuke but has been heavily patched and modified by myself and others.
PHP-Nuke is a free software released under the GNU/GPL.


:: fisubice phpbb2 style by Daz :: PHP-Nuke theme by www.nukemods.com ::
:: fisubice Theme Modified by the RavenNuke™ Team ::

:: W3C CSS Compliance Validation :: W3C HTML 4.01 Transitional Compliance Validation ::

zerosum