1

(3 replies, posted in Programming)

I totally changed everything about the script wink Ill update here when I have time.
Oh and I am using those 2 as primary already.

2

(3 replies, posted in Programming)

<?php

define('PUN_ROOT', './');
require PUN_ROOT.'include/common.php';
require PUN_ROOT.'header.php';
include PUN_ROOT.'tlhead.php';



//Make sure they use the form to access this page
if (isset($_POST['submit'])) 
{
    //Insert a new attempt MySQL is set to make sure only one new attempt is put in per day / per user
    $query = "INSERT INTO pun_contest (username, last_try) VALUES ('" . $pun_user['username'] . "', NOW())"; 
    $result = $db->query($query); 
    
    //If  they are allowed to enter a new attempt at this time 
    if ($result != $db->error) 
    { 
    echo "Your attempt has been added to the total."; 
    }
    //If they are not allowed to enter a new attempt at this time
    if ($result == $db->error) 
    {
    echo "You may only make one new attempt per day.";
    }
    //If they are the correct number to have tried, they win
    if ($db->num_rows($result) == 1)
    {
    echo 'Congratulations, you are the first.';
    }
}
else
{
echo "New challenges must be sent from the correct page.";
}
    
require PUN_ROOT.'footer.php';

3

(7 replies, posted in PunBB 1.2 discussion)

Tables, fields etc..
I have started working on it already. Ill show you what I have come up with so far.
Drop me a line at JcTowelie @ aim or julian_carson@hotmail.com
I have msn and aim

It is as of now seperate, I think I will integrate it into punbb though.
It will be on a site with no forums or things of such nature. I do however quite like a lot of punbb's source so I may do it that way. Any help / advice would be great on this matter.

5

(7 replies, posted in PunBB 1.2 discussion)

Hey I like that idea. I was thinking of doing the same thing.
I'll take a quick look through. (no forums right?)

Were you thinking DB schematics aswell or is that a secondary thought?
Do you have an im?

*Seperate from punbb

Okay, I am creating a contest where the winner will be #x viewer to the page. But.. it gets a bit more complicated than that.
For example let's say:
- This page is accessed from another page using a form
- People can attempt at winning every 24 hours
- People are registered users
- The 100th person is the winner

Now I believe I would need two tables to do this. A users table and a contest table. The contest table would create a new row that includes the username, ip adress, and current time, only if 24 hours have passed, since the last time that user had created a row.

Now I know my code is completely wrong on this one. I do plan on rewriting it. Don't focus on the code too much. The comments in it are okay, I am mainly looking for suggestions on how to go about creating this little script.
wink


<?php

//Get the required db connection info
require 'config.php';

//Make sure they use the form to access this page
if (isset($_POST['submit'])
{
    //Query the database for the user viewing this page
    $query = 'SELECT * FROM users WHERE username='.$username;
    $result = mysql_query($query) or die ('Could not get username:' . mysql_error());
    
    //If the field last_try is not empty and the current time since that field has been modified is greater than 24 hours we update
    if (!empty($result['last_try'] && $result['last_try'] >= //24 HOURS????)
    {

    }
    
    //If last_try is empty we will insert the current time 
    if (empty($result['last_try']) 
    {
    $query = 'INSERT INTO users (last_try) VALUES (NOW())';
    $result = mysql_query($query) or die ('Could not insert last try:' . mysql_error());
    }
    
    //Query the database for all last_try values
    $query = 'SELECT * FROM users';
    $result = mysql_query($query) or die ('Could not get users:' . mysql_error());
    
    //If there are the right number of attempts at the challenge, the user wins
    if (num_rows($result['last_try']) == $win)
    {
    function win;
    }
    
    //If there are not the right number of attempts, the user does not win 
    if(num_rows($result['last_try'] != $win)
    {
    function loss;
    }
}

    //If this page was not accessed using the form on previous page then give an error message
    else
    {
    echo 'This page must be accessed from the '.$pagename.' page';
    }
    
?>

7

(3 replies, posted in PunBB 1.2 discussion)

No, just a small blurb of the 5 most recent topics that shows for example the first 50 characters of the first post in each.

8

(3 replies, posted in PunBB 1.2 discussion)

Is it possible to display part of a message aswell as just the topic name on say a miniportal page.
ex: here or here

9

(2 replies, posted in PunBB 1.2 discussion)

Good idea thanks.
It is for a fairly small niche demographic. I guess you could say it is a clan site; however, it is more related to this challenge system I'm developing. Its based on improvisational skill of players in Tony Hawk games. Basically people have to judge it, its not like in game scores and stuff. Its a bit hard to explain. But Ill do my best on the front page, and update here after I finish.

10

(2 replies, posted in PunBB 1.2 discussion)

I'm making a little portal type of page. I don't really know what else I can include on this thing. I don't want it to be loaded with unnecessary stuff; I would like some more ideas for the left sidebar. If you have an ideas let me know.

http://thpsvids.com/users/gfg/ihome.php

edit: My browser goes wonky when I view the page? I am using opera 9, could it be something to do with the rss feed on the page?
It seems to work perfectly fine in FF and IE tab (FF add-on); although it does look better in regular FF.

I have had this problem on other pages on my site with opera before. sad
Hmm, it isn't screwing up in Opera now. Sometimes it works, sometimes not.

Anyway, any new ideas for the page would be great!

Any thoughts on going about getting multiple chat boxes on pages such as this... http://thpsvids.com/users/gfg/iprofile.php?id=3

What are the best chatbox mods already available that I could potentially modify.

12

(5 replies, posted in PunBB 1.2 discussion)

Strangely, it also displays improperly in opera. (I hope)

13

(5 replies, posted in PunBB 1.2 discussion)

Just found this punbb powered site

http://forum.kh0d.com/index.php

14

(9 replies, posted in PunBB 1.2 discussion)

Yea, I was just checking out firebug. I remember now why FF was a love hate relationship. The ram usage just got out of control with add ons. The extra features were just so nice though. I think ill stick to editing in notepad++ (will prolly end up being faster for me anyway lol).

15

(9 replies, posted in PunBB 1.2 discussion)

Okay, its just because I recently reinstalled my OS, and have switched to using lighter software like notepad++ instead of dreamweaver and Opera instead of FF. I guess Ill use FF when I do some dev stuff like that then. Tamper Data, No script, and IE tab are some of my favourites in FF anyway.

Im looking  through FF addons, do you remember what the thing is called?
"Stylish"?

16

(9 replies, posted in PunBB 1.2 discussion)

I use WAMP right now, but I meant actually, like not having to go through multiple steps. Just one easy thing that would let you examine changes online in 'real time' I guess you would say, but not actually edit.

17

(9 replies, posted in PunBB 1.2 discussion)

Okay, this isn't really 100% punbb related. I am trying to find a way to edit css live. I use Opera as my web browser, and would prefer not to use other things like a firefox add on to achieve the result. I don't want to actually 'change' the css live just test out new css edit css and examine if it would or would not work.

Let me try that, one sec.

Sweet, thx so much! Got it workin.
big_smile

I think I am either missing something or doing something improperly

/****************************************************************/
/* 5. VERTICAL AND PAGE SPACING */
/****************************************************************/

/* 5.1 Page margins */


#punwrap { width: 700px; margin:auto
}
/* 5.2 Creates vertical space between main board elements (Margins) */ ...

#punwrap { width:700px auto
}


That's how it looks now. Still not working. I think I should have kept part of the HTML, BODY in but idk.. ?

Click website in my left post profile. You will see that when you scroll the window, no matter what browser you are using (unless you have a browser that does not support css, which is highly unlikely) the forum changes width to fit the window.

Okay, so I followed those directions and its still not working. Any idea of what to try next?

I know how to change the width already. I need to make it a fixed width.

Heres my css.

/****************************************************************/
/* 1. IMPORTED STYLESHEETS */
/****************************************************************/

/* Import the basic setup styles */
@import url(imports/base.css);
/* Import the colour scheme */
@import url(imports/Quartz_cs.css);

/*POLL MOD*/
p.poll_info {
text-align: center;
clear: left;
margin: 7px;
}
div.poll_question {
float: left;
clear: both;
text-align: right;
width: 50%;
margin: 0.3em;
height: 1.2em;
}
div.poll_result,div.poll_result_yesno {
float: left;
text-align: left;
width: 45%;
margin: 0.3em;
padding: 0;
height: 1.2em;
line-height: 1.2em;
}
    div.poll_result_yesno {
    width: 22%;
    margin-right: 0.1em;
    }
img.poll_bar {
border-right: 2px solid #0066B9; 
background-color: #006FC9;
height: 1.2em;
margin: 0;
}
/****************************************************************/
/* 2. TEXT SETTINGS */
/****************************************************************/

/* 2.1 This sets the default Font Group */

.pun, .pun INPUT, .pun SELECT, .pun TEXTAREA, .pun OPTGROUP {
    FONT-FAMILY: "Trebuchet MS",Trebuchet, Verdana, Arial, Helvetica, sans-serif
}

.pun {FONT-SIZE: 11px; LINE-HEIGHT: normal}

/* IEWin Font Size only - to allow IEWin to zoom. Do not remove comments \*/
* HTML .pun {FONT-SIZE: 68.75%}
/* End IE Win Font Size */

/* Set font size for tables because IE requires it */
.pun TABLE, .pun INPUT, .pun SELECT, .pun OPTGROUP, .pun TEXTAREA, DIV.postmsg P.postedit {FONT-SIZE: 1em}

/* 2.2 Set the font-size for preformatted text i.e in code boxes */

.pun PRE {FONT-FAMILY: monaco, "Bitstream Vera Sans Mono", "Courier New", courier, monospace}

/* 2.3 Font size for headers */

.pun H2, .pun H4 {FONT-SIZE: 1em}
.pun H3 {FONT-SIZE: 1.1em}
#brdtitle H1 {FONT-SIZE: 1.4em}

/* 2.4 Larger text for particular items */
DIV.postmsg P {LINE-HEIGHT: 1.4}
DIV.postleft DT {FONT-SIZE: 1.1em}
.pun PRE {FONT-SIZE: 1.2em}

/* 2.5 Bold text */

DIV.postleft DT, DIV.postmsg H4, TD.tcl H3, DIV.forminfo H3, P.postlink, DIV.linkst LI,
DIV.linksb LI, DIV.postlinksb LI, .blockmenu LI, #brdtitle H1, .pun SPAN.warntext, .pun P.warntext {FONT-WEIGHT: bold}

/****************************************************************/
/* 3. LINKS */
/****************************************************************/

/* 3.1 Remove underlining for main menu, post header links, post links and vertical menus */

#brdmenu A:link, #brdmenu A:visited, .blockpost DT A:link, .blockpost DT A:visited, .blockpost H2 A:link,
.blockpost H2 A:visited, .postlink A:link, .postlink A:visited, .postfootright A:link, .postfootright A:visited,
.blockmenu A:link, .blockmenu A:visited {
    TEXT-DECORATION: none
}

/* 3.2 Underline on hover for links in headers and main menu */

#brdmenu A:hover, .blockpost H2 A:hover {TEXT-DECORATION: underline}

/****************************************************************/
/* 4. BORDER WIDTH AND STYLE */
/****************************************************************/

/* 4.1 By default borders are 1px solid */

DIV.box, .pun TD, .pun TH, .pun BLOCKQUOTE, DIV.codebox, DIV.forminfo, DIV.blockpost LABEL {
    BORDER-STYLE: solid;
    BORDER-WIDTH: 1px
}
.pun th {border:none; }

/* 4.2 Special settings for the board header. */

#brdheader DIV.box {BORDER-TOP-WIDTH: 4px}

/* 4.3 Borders for table cells */

.pun TD, .pun TH {
    BORDER-BOTTOM: none;
    BORDER-RIGHT: none
}

.pun .tcl {BORDER-LEFT: none}

/* 4.4 Special setting for fieldsets to preserve IE defaults */

DIV>FIELDSET {
    BORDER-STYLE: solid;
    BORDER-WIDTH: 1px
}

/****************************************************************/
/* 5. VERTICAL AND PAGE SPACING */
/****************************************************************/

/* 5.1 Page margins */

HTML, BODY {MARGIN: inherit; PADDING: inherit}
#punwrap { width:700px; margin:12px auto
}

/* 5.2 Creates vertical space between main board elements (Margins) */

DIV.blocktable, DIV.block, DIV.blockform, DIV.block2col, #postreview {MARGIN-BOTTOM: 12px}
#punindex DIV.blocktable, DIV.blockpost {MARGIN-BOTTOM: 6px}
DIV.block2col DIV.blockform, DIV.block2col DIV.block {MARGIN-BOTTOM: 0px}

/* 5.3 Remove space above breadcrumbs, postlinks and pagelinks with a negative top margin */

DIV.linkst, DIV.linksb {MARGIN-TOP: -12px}
DIV.postlinksb {MARGIN-TOP: -6px}

/* 5.4 Put a 12px gap above the board information box in index because the category tables only
have a 6px space beneath them */

#brdstats {MARGIN-TOP: 12px}

/****************************************************************/
/* 6. SPACING AROUND CONTENT */
/****************************************************************/

/* 6.1 Default padding for main items */

DIV.block DIV.inbox, DIV.blockmenu DIV.inbox {PADDING: 3px 6px}
.pun P, .pun UL, .pun DL, DIV.blockmenu LI, .pun LABEL, #announce DIV.inbox DIV {PADDING: 3px 0}

.pun H2 {PADDING: 6px 5px 12px}

/* 6.2 Special spacing for various elements */

.pun H1 {PADDING: 3px 0px 0px 0}
#brdtitle P {PADDING-TOP: 0px}
DIV.linkst {PADDING: 8px 6px 3px 6px}
DIV.linksb, DIV.postlinksb {PADDING: 3px 6px 8px 6px}
#brdwelcome, #brdfooter DL A, DIV.blockmenu LI, DIV.rbox INPUT  {LINE-HEIGHT: 1.4em}
#viewprofile DT, #viewprofile DD {PADDING: 0 3px; LINE-HEIGHT: 2em}

/* 6.4 Create some horizontal spacing for various elements */

#brdmenu LI, DIV.rbox INPUT, DIV.blockform P INPUT  {MARGIN-RIGHT: 12px}

/****************************************************************/
/* 7. SPACING FOR TABLES */
/****************************************************************/

.pun TH, .pun TD {PADDING: 4px 6px}
.pun TD P {PADDING: 5px 0 0 0}

/****************************************************************/
/* 8. SPACING FOR POSTS */
/****************************************************************/

/* 8.1 Padding around left and right columns in viewtopic */

DIV.postleft DL, DIV.postright {PADDING: 6px}

/* 8.2 Extra spacing for poster contact details and avatar */

DD.usercontacts, DD.postavatar {MARGIN-TOP: 5px}
DD.postavatar {MARGIN-BOTTOM: 5px}

/* 8.3 Extra top spacing for signatures and edited by */

DIV.postsignature, DIV.postmsg P.postedit {PADDING-TOP: 15px}

/* 8.4 Spacing for code and quote boxes */

DIV.postmsg H4 {MARGIN-BOTTOM: 10px}
.pun BLOCKQUOTE, DIV.codebox {MARGIN: 5px 15px 15px 15px; PADDING: 8px}

/* 8.5 Padding for the action links and online indicator in viewtopic */

DIV.postfootleft P, DIV.postfootright UL, DIV.postfootright DIV {PADDING: 10px 6px 5px 6px}

/* 8.6 This is the input on moderators multi-delete view */

DIV.blockpost INPUT, DIV.blockpost LABEL {
    PADDING: 3px;
    DISPLAY: inline
}

P.multidelete {
    PADDING-TOP: 15px;
    PADDING-BOTTOM: 5px
}

/* 8.7 Make sure paragraphs in posts don't get any padding */

DIV.postmsg P {PADDING: 0}

/****************************************************************/
/* 9. SPECIAL SPACING FOR FORMS */
/****************************************************************/

/* 9.1 Padding around fieldsets */

DIV.blockform FORM, DIV.fakeform {PADDING: 20px 20px 15px 20px}
DIV.inform {PADDING-BOTTOM: 12px}

/* 9.2 Padding inside fieldsets */

.pun FIELDSET {PADDING: 0px 12px 0px 12px}
DIV.infldset {PADDING: 9px 0px 12px 0}
.pun LEGEND {PADDING: 0px 6px}

/* 9.3 The information box at the top of the registration form and elsewhere */

DIV.forminfo {
    MARGIN-BOTTOM: 12px;
    PADDING: 9px 10px
}

/* 9.4 BBCode help links in post forms */

UL.bblinks LI {PADDING-RIGHT: 20px}

UL.bblinks {PADDING-BOTTOM: 10px; PADDING-LEFT: 4px}

/* 9.5 Horizontal positioning for the submit button on forms */

DIV.blockform P INPUT {MARGIN-LEFT: 12px}

/****************************************************************/
/* 10. POST STATUS INDICATORS */
/****************************************************************/

/* 10.1 These are the post status indicators which appear at the left of some tables. 
.inew = new posts, .iredirect = redirect forums, .iclosed = closed topics and
.isticky = sticky topics. By default only .inew is different from the default.*/

div.icon {
    float: left;
    display: block;
    width:20px;
    height:20px;
}
DIV.searchposts DIV.icon {MARGIN-LEFT: 0}

/* 10.2 Class .tclcon is a div inside the first column of tables with post indicators. The
margin creates space for the post status indicator */

TD DIV.tclcon {MARGIN-LEFT: 2.3em}

Maybe if I change this:
#punwrap { width:700px; margin:12px auto }

to
#punwrap { width:700px; margin:12px}
?

How can I tell the thing to be a fixed width. So that when ppl scroll the window the forums size remains the same.

25

(3 replies, posted in PunBB 1.2 show off)

Nice, you should do some css on drop down select box -> jump to forum.