You are browsing this forum as a guest. Click this bar to register and get full member benefits.
NovaBoard Support Forums
Free, Open Source Forum Software
Hello Guest!    Login    Register
Poor Mans Portal-boredom
AskAlex
Trackback URL  Saturday, Mar 13, 2010 17:05
Protostar


 
Posts: 59
Joined: 26 December 2009
Location: Ontario

EDIT: GIVE ME TO THE WEEKEND IF YOU WANT TO USE THIS, I FOUND A MINOR BUG. Nope it isn\'t a exploit it\'s just that the script doesn\'t gather users based on latest signup.


I was extremely bored last week so i decided to make a \"portal\" if you can even call it that.

**This code wouldn\'t work out of the box like that it requires modifcations. So no copy+paste.
**Also the areas overlap each other.
**You can do whatever you want with this.
**BBcode isn\'t parsed.
**Remember this code was just made out of boredom.
**no warranty.
**Hasn\'t been tested extensively.
**Please don\'t use this on a production site WITHOUT modifying the css

Raw Code Snippet
<html>
<head>

<style type=\"text/css\">
body {
margin: 0 auto;
margin-top: 20px;
text-align: center;
height: 100%;
position: relative;
background: #5B7188;
font-size: 11px;
font-family: Arial, Verdana, Tahoma, sans-serif;
max-height:500px;
}
.blog-board-post {
vertical-align: top;
text-align: center;
padding: 1px;
background: #fff;
width: 60%;
height: 200px;
font-size: 12px;
line-height: 150%;
min-device-height: 50px;
-moz-border-radius-bottomleft: 10px;
-moz-border-radius-bottomright: 10px;
-moz-border-radius-topleft: 10px;
-moz-border-radius-topright: 10px;
}
.blog-board-head {
width: 60%;
font-size: 13px;
font-weight: bold;
text-align: left;
background: #EFF1F3 repeat-x;
}
.leftcol
{
background: #fff;
float: left;
width:90px;
/* max-width: 200px; */
height: 600px;
max-height:1000px;
}
.rightcol
{
background: #fff;
float: right;
width:90px;
/* max-width: 200px; */
height: 600px;
max-height:1000px;
}
</style>
</head>
<body>
<?php
/*
*\"We must crawl before we can run\"
*\"In a Galaxy far far away..................\"
*Written by AskAlex of community.novaboard.net
*This script comes with no warranties
*any questions just PM me
*/

// turn off error reporting.Who wants error reporting on a production site?
error_reporting(0);

// stupid magic quotes! Magic quotes are a real pain \'nuff said
set_magic_quotes_runtime(0);

ob_start();

session_start();

//This allows us to include includes/config.php because nova_run has to be defined or access is denied
define(\"NOVA_RUN\", 1);
//Next we include the configs file
include (\"includes/config.php\");




//select latest members
$query = \"SELECT * FROM {$db_prefix}members \" ;
//query
$index_php = mysql_query($query) or die(mysql_error());
//fetch array
$MEMBERS = mysql_fetch_array( $index_php ) or die(mysql_error());
//echo
echo \"<div class=leftcol>\". $MEMBERS[\'name\'] . \"</div>\";
echo \"<div class=leftcol>\" .$MEMBERS[\'nationality\']. \"</div>\" ;


//LATEST member right
$query = \"SELECT * FROM {$db_prefix}members WHERE role=\'1\'\" ;
$index_php = mysql_query($query) or die(mysql_error());
while($row = mysql_fetch_array( $index_php )) {
//Prints out all the rows where role = 1 ie admin
echo \"<div class=rightcol>\". $MEMBERS[\'name\'] . \"</div>\";
echo \"<div class=rightcol>\" .$MEMBERS[\'nationality\']. \"</div>\";
}

//Select posts from forumid #5 which is my announcements board.Replace 5 with your forum id.
$query = \"SELECT * FROM {$db_prefix}posts WHERE forum_id=\'5\'\" ;
$index_php = mysql_query($query) or die(mysql_error());
$BLOG = mysql_fetch_array($index_php) or die(mysql_error());
//Latest Announcements center
ECHO \"<center><h1>Latest Announcements</h1></center>\";
echo \"<center>\".\"<div class=blog-board-head>\". $BLOG[\'title\'] . \"</div>\".\"</center>\";
echo \"<center>\".\"<div class=blog-board-post>\" .$BLOG[\'content\']. \"</div>\" .\"</center>\";

//LATEST posts bottom center in forum.This forum has the id of 2,replace 2 with your forum id
$query = \"SELECT * FROM {$db_prefix}posts WHERE forum_id=\'2\'\" ;
$index_php1 = mysql_query($query) or die(mysql_error());
$LATEST = mysql_fetch_array($index_php1) or die(mysql_error());
ECHO \"<center><h1>Latest Post in TOOPRO</h1></center>\";
echo \"<center>\".\"<div class=blog-board-head>\". $LATEST[\'title\'] . \"</div>\".\"</center>\";
echo \"<center>\".\"<div class=blog-board-post>\" .$LATEST[\'content\']. \"</div>\" .\"</center>\";

?>

</body>
</html>


Last edited by: AskAlex - Wednesday, Apr 14, 2010 21:44.

PHP Code Snippet
<?php echo "Insert text here\";?>
Top  
 
Angelo
Saturday, Mar 13, 2010 22:42 | Trackback URL
Head of Security


 
Posts: 620
Joined: 23 August 2009
Location: Heiloo

Installation instructions?



Top  
 
AskAlex
Sunday, Mar 14, 2010 21:40 | Trackback URL
Protostar


 
Posts: 59
Joined: 26 December 2009
Location: Ontario

The post got filtered out.

1.Copy and Paste the above information into

2.Where it says forum_id=\"2\" and forum_id=\"5\" replace the 2 and the 5 with the forum id of the forum you want to see.

3.Save the modified file

4.Upload that file to your web server.

5.Access the file, now modify the css and php NOW!!!!!

6.If you don\'t modify cssnow, this script will implode and cause your database to malfunction. (LOLJK, but seriously please edit the css )

This was just a test and to use it on a production site you would have to modify it.

EDIT: Everytime I use Quick Edit \\\\\'s are added to the threads title. MAGIC QUOTES FTL?

Last edited by: AskAlex - Sunday, Mar 14, 2010 21:50.

PHP Code Snippet
<?php echo "Insert text here\";?>
Top  
 
4J2
Tuesday, Apr 06, 2010 14:31 | Trackback URL
Protostar


 
Posts: 60
Joined: 12 January 2010
Location: Bourgas,Bulgaria

Can you give screenshot of the Portal in action?

Top  
 
AskAlex
Sunday, Apr 11, 2010 22:02 | Trackback URL
Protostar


 
Posts: 59
Joined: 26 December 2009
Location: Ontario

Yeah sure but it might take awhile.   


PHP Code Snippet
<?php echo "Insert text here\";?>
Top  
 
AskAlex
Saturday, Apr 17, 2010 17:55 | Trackback URL
Protostar


 
Posts: 59
Joined: 26 December 2009
Location: Ontario

Here\'s the Screenshot



Attached Image (73.47kb)
Attached Image
99 Downloads
Last edited by: AskAlex - Saturday, Apr 17, 2010 17:56.

PHP Code Snippet
<?php echo "Insert text here\";?>
Top  
 
Pinkie
Sunday, Jan 15, 2012 12:24 | Trackback URL
Protostar


 
Posts: 1
Joined: 15 January 2012

Spoiler Alert Click to View

Top  
 
<< Previous   Next >>
 
1 Guest(s), 0 Member(s) Viewing This Topic:
 
 
Powered by NovaBoard v1.1.4
All Content © NovaBoard Support Forums