php forum
php mysql forum
php mysql smarty
 
Page 1 of 5 1 2 3 4 5 >
Topic Options
#182657 - 12/08/03 10:29 PM CGI page
Felix 10 Offline
Enthusiast

Registered: 10/10/02
Posts: 391
Loc: Toronto
I would like to make a CGI page, just to show the header, the link line and the footer links and Infopop link. Just imagine The forum Summary without any tables.

Am I on a good start?
Code:
#!/usr/bin/perl 

&LoadTemplate("public_common");
%vars_style = &LoadStyleTemplate("summary_page");
&set_page_elements;

@ubber = cookie("ubber$vars_config{Cookie_Number}");
if ($ubber[0] ne '') { $username        = $ubber[0]; }
if ($ubber[1] ne '') { $password        = $ubber[1]; }
if ($ubber[2] ne '') { $pubname         = $ubber[2]; }
if ($ubber[3] ne '') { $user_topic_view = $ubber[3]; }
if ($ubber[4] ne '') { $user_number     = $ubber[4]; }

if (@ubber) {
	@checkTheProfile = &verify_id_num_2($username, $password, $user_number);
	unless ($checkTheProfile[4] =~ /Write/) {
		print header(
			-charset => "$masterCharset",
			-type    => "text/html"
		);
		&StandardHTML("User not approved");
	}
} elsif ($opt{members_only}) {
	&StandardHTML(qq!$vars_wordlets_err{not_logged_in}

 <a href="$vars_config{CGIURL}/ultimatebb.cgi?ubb=login" target="_blank">$vars_wordlets{login_now}</a> $vars_wordlets{or} <a href="$vars_config{CGIURL}/ultimatebb.cgi?ubb=agree" target="_blank">$vars_wordlets{register_title}</a>!);
}

if ($@) {
	print ("Content-type: text/htmlnn");
	print "Error including required files: $@n";
	print "Make sure these files exist, permissions are set properly, and paths are set correctly.";
 	exit;
	}

	$show_logout = qq~
<script language="Javascript" type="text/javascript">
<!--
var user_cookie = getCookie('ubber$vars_config{Cookie_Number}');
if(('' == user_cookie) &#0124;&#0124; (null == user_cookie)) {
	document.writeln('$vars_wordlets{not_logged_in}' , ' <a href="$vars_config{CGIURL}/ultimatebb.cgi?ubb=login">$vars_wordlets{login_now}</a> $vars_wordlets{or} <a href="$vars_config{CGIURL}/ultimatebb.cgi?ubb=agree">$vars_wordlets{register_link}</a>')
} else {
	var user_array=user_cookie.split("&");
	user_array[2] = unescape(user_array[2]);
	document.writeln('$vars_wordlets{hello} ', user_array[2]);
	document.writeln('[ <a title="$vars_wordlets{logout_acronym}" href="$vars_config{CGIURL}/ultimatebb.cgi?ubb=logoff">$vars_wordlets{logout}</a> ]');
} // end else
//-->
</script>
~;

  
If not can someone point me the right way?

Thank you,
Felix

Top
#182658 - 12/09/03 07:16 PM Re: CGI page
RandyM Offline
Spotlight Winner

Registered: 06/28/01
Posts: 2642
Loc: Southern California | Guitar o...
I've wondered about this myself. Hope you get an answer soon.
_________________________
3 time Spotlight winner.
Believe The Lie

Top
#182659 - 12/09/03 08:47 PM Re: CGI page
PrimeTime Offline
Member

Registered: 11/06/01
Posts: 1046
For a basic .cgi file all you need are a few lines inside such as:

Code:
&set_page_elements;

	$ThisHTML = $Header;
	$ThisHTML .= qq~


$Footer
	~;
Anything in between "qq~" and "$footer" is your HTML codes. Now you have your .cgi file. You will now need ultimatebb.cgi to recognize this file when called. To do so add:

In ultimatebb.cgi find:
Code:
# all ubb options:
$ubb = "" unless $ubb;
Add after:

Code:
# whatever_title_here
if ($ubb eq 'file_name') {
	&set_page_elements;
	&RequireCode("$vars_config{CGIPath}/cgi_file_here.cgi");
	&file_name;
	exit(0);
} #end whatever_title_here
And in ubb_lib.cgi find:
Code:
	my %types = (
Add after:
Code:
		'file_name' => q^|file_name|^,
And find:
Code:
	foreach my $type (qw(
Add (with space after):
Code:
file_name 
This will give you the basic .cgi file. Of course you can add other stuff later like:

login info
Recent Vistors recognition
Wordlets
Calendar
Stats
And whatever you want...

Hope this helps. smile
_________________________
Members Spotlight Winner
bac-Clan
--------------------

Top
#182660 - 12/09/03 09:16 PM Re: CGI page
PrimeTime Offline
Member

Registered: 11/06/01
Posts: 1046
With this you can now create your own .cgi Homepage (portal). wink The only thing that I (and Brett laugh ) were stuck on was the inclusion of UBBNews without the use of javascript...We both were targetting a Perl method. We had almost everything else needed in a homepage. I think Bobbitt came up with a code that could do it.

There was a time when many UBB users were heavily interested in a portal. Anyone knows the status (succeeded, ongoing, dead)? *The .cgi version laugh *
_________________________
Members Spotlight Winner
bac-Clan
--------------------

Top
#182661 - 12/10/03 01:00 AM Re: CGI page
AllenAyres Administrator Offline
I type Like navaho

Registered: 03/10/00
Posts: 25461
Loc: Texas
creating an index.cgi would be fairly simple after all the hassle I've been through with the various scripts the last few months (games, links, etc). tipsy

ubbnews would be the toughy, unless mike's script can be included like a content island smile
_________________________
- Allen wavey
- What Drives You?

Top
#182662 - 12/11/03 03:12 PM Re: CGI page
Felix 10 Offline
Enthusiast

Registered: 10/10/02
Posts: 391
Loc: Toronto
Allen, I was going to ask you pesonally anyways. The template I was trying to develop into a page I took from your games.cgi because it is the simples ever of all and it is a stand alone.

My question to was was:
what shoud I delete from the games.cgi script so I dont get the games table, just an empty page so I can insert my own codes into it ?

Thank you,
Felix

Top
#182663 - 12/11/03 03:20 PM Re: CGI page
Felix 10 Offline
Enthusiast

Registered: 10/10/02
Posts: 391
Loc: Toronto
Prime, the code you gave me up above. Is this how you start the page? Isnt there anything to call the forum template into the new page? Or ultimatebb.cgi would do that?

Why cant this page stand alone like Allen's Games.cgi or Mike's album.pl without being necessary to call it through ultimatebb ?

Thank you,
Felix

Top
#182664 - 12/12/03 12:49 AM Re: CGI page
AllenAyres Administrator Offline
I type Like navaho

Registered: 03/10/00
Posts: 25461
Loc: Texas
Quote:
quote:
Originally posted by Felix 10:

My question to was was:
what shoud I delete from the games.cgi script so I dont get the games table, just an empty page so I can insert my own codes into it ?

Thank you,
Felix
Change showmain to showindex and call the file index.cgi...

that's probably too simple... once you've included the ubb files like at the top of the page, you need showindex to do the startpage and endpage, with the other stuff tossed in between tipsy

You can add content islands for most content, a ubbnews script for some other content, etc etc etc.

I can look at it at some point, I really wanna get the links script further down the road smile
_________________________
- Allen wavey
- What Drives You?

Top
#182665 - 12/13/03 04:19 AM Re: CGI page
PrimeTime Offline
Member

Registered: 11/06/01
Posts: 1046
Quote:
quote:
Originally posted by Felix 10:
Prime, the code you gave me up above. Is this how you start the page? Isnt there anything to call the forum template into the new page? Or ultimatebb.cgi would do that?

Why cant this page stand alone like Allen's Games.cgi or Mike's album.pl without being necessary to call it through ultimatebb ?

Thank you,
Felix
I haven't checked the Games.cgi or album.pl but the code I posted is probably the easiest method to having a fully (UBB) intergrated .cgi page. From login to PM to Wordlets to Recent Visitors to Search and more...It's all possible through this one page. The "ultimatebb.cgi" is the heart of UBB so you want all of your UBB pages to go through it..."ubb_lib.cgi" is also a criticial file. While a separate CSS can be used, because this .cgi page is another UBB page, it uses the routines in "public_common.pl" (e.g., templates ($TBT and $TBB), header, footer, etc.).

The code I posted is the skeleton of what the Homepage was(is) to be, but you can use it for anything really. It doesn't matter whether it's .cgi or .pl...I just preferred .cgi. A standalone won't cut it in my opinion...Not for a Homepage...Not for a UBB page.
_________________________
Members Spotlight Winner
bac-Clan
--------------------

Top
#182666 - 12/13/03 04:23 AM Re: CGI page
PrimeTime Offline
Member

Registered: 11/06/01
Posts: 1046
Felix - Please explain further so we know what you're trying to do.
_________________________
Members Spotlight Winner
bac-Clan
--------------------

Top
#182667 - 12/13/03 07:08 PM Re: CGI page
Felix 10 Offline
Enthusiast

Registered: 10/10/02
Posts: 391
Loc: Toronto
Prime, I read and I read ..and the more I read the dumber I get.....LOL.

Okay, I want to make a page, just a page not the Homepage, in which to integrate an other one,
this: http://romanianational.com/cgi-bin/album.pl so it looks like is part of the UBB board (header, footer, links line). Pretty much same thing Allen did with the Games: http://romanianational.com/cgi-bin/games.cgi

Do you understand? Dont take it wrong Prime, I dont doubt you understand, I very much doubt I explain properly smile

Thank you,
Felix

Top
#182668 - 12/13/03 09:33 PM Re: CGI page
RandyM Offline
Spotlight Winner

Registered: 06/28/01
Posts: 2642
Loc: Southern California | Guitar o...
Quote:
quote:
Originally posted by PrimeTime:
With this you can now create your own .cgi Homepage (portal). wink The only thing that I (and Brett laugh ) were stuck on was the inclusion of UBBNews without the use of javascript...We both were targetting a Perl method. We had almost everything else needed in a homepage. I think Bobbitt came up with a code that could do it.

There was a time when many UBB users were heavily interested in a portal. Anyone knows the status (succeeded, ongoing, dead)? *The .cgi version laugh *
I think that a *semi-supported* UBB Portal would drastically increase the traffic and member participation here. I think that would be a VERY good thing for UBBDev.
_________________________
3 time Spotlight winner.
Believe The Lie

Top
#182669 - 12/14/03 02:24 PM Re: CGI page
AllenAyres Administrator Offline
I type Like navaho

Registered: 03/10/00
Posts: 25461
Loc: Texas
Quote:
quote:
Originally posted by PrimeTime:
I haven't checked the Games.cgi or album.pl but the code I posted is probably the easiest method to having a fully (UBB) intergrated .cgi page. From login to PM to Wordlets to Recent Visitors to Search and more...It's all possible through this one page. The "ultimatebb.cgi" is the heart of UBB so you want all of your UBB pages to go through it..."ubb_lib.cgi" is also a criticial file. While a separate CSS can be used, because this .cgi page is another UBB page, it uses the routines in "public_common.pl" (e.g., templates ($TBT and $TBB), header, footer, etc.).

The code I posted is the skeleton of what the Homepage was(is) to be, but you can use it for anything really. It doesn't matter whether it's .cgi or .pl...I just preferred .cgi. A standalone won't cut it in my opinion...Not for a Homepage...Not for a UBB page.
standalone requires a few less files... not many, but a few smile could help with server load, especially if all you're doing is reading a cookie, and requiring a few subs... it's different if they're actually needing to post to the front page or something.
_________________________
- Allen wavey
- What Drives You?

Top
#182670 - 12/15/03 01:51 AM Re: CGI page
AllenAyres Administrator Offline
I type Like navaho

Registered: 03/10/00
Posts: 25461
Loc: Texas
argh.. looked at this again tonight... getting the header/footer for some generic page is simple - deciding what content to include for an index page is difficult at best - it assumes everyone wants the same layout, wants the same content, etc... should there be 1, 2, or 3 or even 4 columns?

I'll write a blank one and give a big ol' PUT YOUR CONTENT HERE pointer until someone has time to write something more substantial.
_________________________
- Allen wavey
- What Drives You?

Top
#182671 - 12/15/03 02:55 AM Re: CGI page
PrimeTime Offline
Member

Registered: 11/06/01
Posts: 1046
I already posted the code above (3rd post)...It shouldn't be any easier than that. smile I didn't include additional content but it won't be difficult to include (with exception to the UBBNews) because it's already written from previous hacks and codes...It's just a matter of cut and paste. (Allen seen the quick-make page a while back.) Custom templates is as difficult as the complexity of the designs.

UBBNews and CP intergration are the only two things will make it complete. For what Felix wants to do, however, everything is already there to make the page (Header/Footer). smile Unless you're thinking something different than I am. laugh
_________________________
Members Spotlight Winner
bac-Clan
--------------------

Top
#182672 - 12/17/03 12:43 AM Re: CGI page
Felix 10 Offline
Enthusiast

Registered: 10/10/02
Posts: 391
Loc: Toronto
Prime, it is not working. A few problems:

1. I get a page but with a error message:

" Undefined subroutine &main::album called at ultimatebb.cgi line 557."


Note: my editor starts with 00001 not 00000.

2. I have a "Content-type: text/html " in the left top corner

3. the style template is not the one I am curently using.


This is the page:

Code:
 
 &set_page_elements;

$ThisHTML = $Header;
$ThisHTML .= qq~



TESTING THE NEW .CGI PAGE

TESTINGGGGGGGGGGGGGGG



TESTING THE NEW .CGI PAGE



TESTING THE NEW .CGI PAGE




$Footer
~; 
Thank you

Top
#182673 - 12/19/03 01:46 AM Re: CGI page
AllenAyres Administrator Offline
I type Like navaho

Registered: 03/10/00
Posts: 25461
Loc: Texas
_________________________
- Allen wavey
- What Drives You?

Top
#182674 - 12/19/03 02:33 AM Re: CGI page
PrimeTime Offline
Member

Registered: 11/06/01
Posts: 1046
LOL Allen. OK...I see now.

As for Felix, the code does work. Sometime tomorrow or the weekend I'll have the page + code (instead of just codes).
_________________________
Members Spotlight Winner
bac-Clan
--------------------

Top
#182675 - 12/19/03 03:16 PM Re: CGI page
Felix 10 Offline
Enthusiast

Registered: 10/10/02
Posts: 391
Loc: Toronto
Allen, how do I get the script for that? without the sidepanels?

Prime, ok, I will wait for it.

Thank you very much

Felix

Top
#182676 - 12/19/03 04:29 PM Re: CGI page
AllenAyres Administrator Offline
I type Like navaho

Registered: 03/10/00
Posts: 25461
Loc: Texas
I'll post it shortly - going out of town tho, so if it's not today, will be done Sunday.

It uses whatever header/footer you use on your forum summary, so if you have sidepanels it uses them, if not, not smile
_________________________
- Allen wavey
- What Drives You?

Top
Page 1 of 5 1 2 3 4 5 >


Moderator:  Gizmo 
Who's Online
0 registered (), 22 Guests and 18 Spiders online.
Key: Admin, Global Mod, Mod
Shout Box

Latest Posts
ubb.social
by Placebo
Yesterday at 04:25 AM
Displaying a gif for a paying member
by Iann128
01/06/09 07:04 AM
Restore The "New Topic Is Highlighted" Feature
by hikelite
01/02/09 07:41 PM
Web Hosting
by Pilgrim
01/02/09 04:13 PM
Finishing touches on a UBB migration
by AllenAyres
01/02/09 03:04 PM
Sidebar options?
by Pilgrim
12/26/08 03:40 PM
Legacy Style
by sirdude
12/24/08 07:18 PM
New Mods
Displaying a gif for a paying member
by Iann128
12/29/08 11:44 AM
Legacy Style
by Micky
12/21/08 01:36 PM
ubb.social
by
08/03/06 10:38 AM
Newest Members
bluedthunder, blaqskreen, RAICHU, sebak, BaronDriver
13371 Registered Users
Top Posters
AllenAyres 25461
JoshPet 11330
Rick 8372
LK 7396
Lord Dexter 6503
Greg Hard 5533
Charles Capps 5438

 

 

 
fusionbb message board php hacks