 |
 |
 |
 |
#182657 - 12/08/03 10:29 PM
CGI page
|
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? #!/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) || (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
|
|
|
|
 |
 |
 |
 |
 |
 |
 |
 |
#182659 - 12/09/03 08:47 PM
Re: CGI page
|
Member
Registered: 11/06/01
Posts: 1046
|
For a basic .cgi file all you need are a few lines inside such as: &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: # all ubb options:
$ubb = "" unless $ubb; Add after: # 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_hereAnd in ubb_lib.cgi find: Add after: 'file_name' => q^|file_name|^, And find: Add (with space after): 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. 
|
|
Top
|
|
|
|
 |
 |
 |
 |
 |
 |
 |
 |
#182667 - 12/13/03 07:08 PM
Re: CGI page
|
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 Thank you, Felix
|
|
Top
|
|
|
|
 |
 |
 |
 |
 |
 |
 |
 |
#182669 - 12/14/03 02:24 PM
Re: CGI page
|
I type Like navaho
Registered: 03/10/00
Posts: 25452
Loc: Texas
|
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  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.
|
|
Top
|
|
|
|
 |
 |
 |
 |
 |
 |
 |
 |
#182672 - 12/17/03 12:43 AM
Re: CGI page
|
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:
&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
|
I type Like navaho
Registered: 03/10/00
Posts: 25452
Loc: Texas
|
|
|
Top
|
|
|
|
 |
 |
 |
 |
|
|