Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    PHP




Dynamic Message Board Menu


Here's an issue I've spent the last 8 hours trying to get my head around, I'm pretty sure the answer is simple enough, but I just cannot work it out, any help would be much appreciated...even just a function name or something...

I have a very simple message board setup. The browse menu will look end up like below, all dynamically fed from a database, which is currently setup as:

[articleID] [articleDate] [articleText]
      23      2007-07-18  Lorem ipsum dolor....

The 'articleDate' field is a DATE type, formatted yyyy-mm-dd. All posts should be sorted ascending, latest first. I want nothing to be hard coded, so there could be 2 posts in any month, or 200, or there could be no posts in any year.

2007
June
 - #1
 - #2
August
 -#1
September
 -#1
 -#2

2008
January
 -#1
.
.
.
.
.
So on and so on.

So far, I've toyed with array_unique(), as well as multi-dimensional arrays, but I'm really not sure if this is the right approach. I'd post code but I'm not sure there's any point, what I'm really looking to find out is the method to use, rather than code snippets, so if anyone has achieved this, how did you do it?  I'm happy as to teach myself whatever I need to know, problem is I don't know what I need to know...




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Making A PHP Message Board
In PHP, how would I mark posts differently if the user read it than if the user didn't read it. If there is a new reply since the user last read the post, then mark the post as unread. What would the best way to do this be? Cookies, sessions, etc.

Calendar And Message Board Class/Application
A designer friend of mine is looking to create a web site for a group of
people who share ownership of a property. The two things they would like to
do would be to have a calendar function so the people could log in and
schedule their time at the property, and a message board functionality to
post messages for the other owners. It probably doesn't need to be
something as complex as PHPBB, but just something simple for the owners.
Does anybody know of an existing PHP class or application that could provide
that functionality?

Dynamic Menu CSS
I am trying for a long time now, to find a way of creating a dynamic drop
down menu. I have the CSS part ready and working and also I have the first
level of the menu working.
the problem I have is how can I submit the id from the first level menu in
order to make the query and create the second level and so on menu.

I am trying to avoid Javascript but I can't see another way at the moment...
What I want to achieve is to produce the menu on HOVER if that is not
possible on click will be ok as well.
Do any of you have an idea ?

This is the code I have :
**********************************************
<div id="menu">
<ul>
<li><h2>Products</h2>
<ul>
<?php do { ?>
<li><a href="?cat_id=<?php echo
($row_product_categories['prod_category_id']); ?>"title="<?php echo
strtoupper($row_product_categories['prod_category_name']); ?>"><?php echo
ucfirst($row_product_categories['prod_category_name']); ?></a></li>
<?php }
while ($row_product_categories =
mysql_fetch_assoc($rs_product_categories)); ?>
<ul>

<?php do { ?>
<li><a href="index.php?id=<?php echo ($row_products['prod_id']);
?>"title="<?php echo strtoupper($row_products['prod_name']); ?>"><?php echo
ucfirst($row_products['prod_name']); ?></a></li>
<?php }
while ($row_products = mysql_fetch_assoc($rs_products)); ?>

</ul>
</li>
</ul>
</li>
</ul>
</div>
**************************************************

Mysql Php Dynamic Menu
I am trying to write a script that will create dynamically a menu from MySQL
database. The database table is a product categories table and it has the folowing filed:

category_id, parent_category_id, category_name (some other fileds are there
as well but these are enough to figure out the logic)

I know that I have to store all the product_categories records in a temp
array and then some how go through them and store the level of each record
in the menu....

If you have done something like that I suppose you know what I mean and I
would much appreciate to give me a hint here ...
I had a look in the phpLayersMenu from sourceforge but it is really advanced
OO code and I cannot understand the logic....

My target is to create a Tree menu with no pre - defined number of
records...

Dynamic Navigation Menu
I need to build a dynamic menu that will include certain links depending on what variables are in the URL. This is doable - right?

For example: catalog.php?product=widget&color=green

Menu would look like:

Green Widgets
Brand 1 Green Widget
Brand 2 Green Widget
Brand 3 Green Widget
etc.

Any help would be greatly appreciated!

Dynamic Select Menu
I am trying to populate a select menu with data from a mysql db. I get the select menu, but no content or errors. The two fields are id and websites. Here is the code:

Dynamic Drop Down Menu
I'm having difficulties displaying the MakeModelID for a row selected from a drop down menu I've populated from a table combining three attributes (Make, Model and Specification - for example Ford Transit LWB 350 HR). What I require is to capture in a variable, such as $MakeModelID, the ID for that record selected. Code:

Creating Dynamic Drop Down Menu
I have a mysql database called Auditions with a table called Sept7. The table has two columns Time and Name. I want to create a dynamic pull down menu and populate it with items pulled from the table based on a query. Code:

Dynamic MySQL Nav Menu Sorting
I have this dynamic menu and I want to change the order of the menu items...
I added a column in the database wich has an integer value for ordering the
menuitems.
But the only way is by hardcoding them into the database.

I would like a way to sort them with drag-and-drop or with up/down arrows.

Do you think that except PHP & MYsql I will need Javascript as well ?
Any ideas how to do that ?

Dynamic Menu Bar In A Frame - Controlling Frames In Php?
I have been using in a lot of websites a script that creates a menu bar but
avoids that the button to the current page can be clicked.
I am rather satisfied with it (although suggestions for better ways of doing
things are welcome, the script follows below FYI)
No there is a a problem that for a new site (www.orkestbasic.nl/nieuw) the
menu with the links has to be placed in a separate frame because the right
part of the page must be scrollable. So the check wether a button has to be
a link or not cannot be done anymore with checking PHP_SELF as I am used to
do.
I am thinking of making all the links to something like <a href =
"main.php?content=songlist">
then main.php would be a frameset with something like <frame name =
"content" src = "<?php echo "$content.php"?>">
In the left frame I could do a similar thing with a small modification to
the createlink function (see below) I often use.
But I would like to know if there are more elegant suggestions for it. Could
not find really good tips on google. Thanks for any help

FYI This is the function I have been using until now.

function mvwMaakLink($omschrijving, $verwijzing, $separator = "",
$aHrefClass = "", $noHrefClass = "")
{
$locatie = $_SERVER['PHP_SELF'];
//link to the current page, no need for clicking on
it
//echo $locatie;
if (strstr($locatie, $omschrijving))
{
$beginTag = "";
$slotTag = "";
if ($noHrefClass != "")
{
$beginTag = "<span class = "$noHrefClass">";
$slotTag = "</span>";
}
echo "$beginTag$verwijzing$slotTag";
}
else
{
$beginTag = "<a ";
if ($aHrefClass != "")
{
$beginTag .= "class = "$aHrefClass" ";
}
$beginTag .= "href = "$omschrijving">";
echo("$beginTag$verwijzing</a>$separator");
}
}

Unexpected Order On Dynamic Select Menu
I've got a directory called 'potm' (picture of the month) that contains:

02.jpg
03.jpg
04.jpg

I'm dynamically constructing an 'archive' select menu that contains all the available pics. For some reason the select menu reads:

April
February
March

I've tried to sort the array, but it made no difference. PHP Code:

Page Has Expired Message In Between The Php Page When I Click Back In Explorer Menu
I have a php script page, which is basically quiz. Visitors (after login in
with their email address) are supposed to answer each question, and when
they click the button at the bottom, the next page will show which problems
they got right or wrong.

Now my visitors, after seeing some problems they got wrong, click Back
button at the Explorer menu, and if they do, they get the below message:
=========================
Warning: Page has Expired The page you requested was created using
information you submitted in a form. This page is no longer available. As a
security precaution, Internet Explorer does not automatically resubmit your
information for you.

To resubmit your information and view this Web page, click the Refresh
button.
========================
Below are the script that I am using. This scripts are after initial login
page, which asks for visitor's email address. I have authorized visitors
already in my MySQL table, and only the visitors whose email address is in
my MySQL table are allowed to login......

[PEAR:QuickForm] Dynamically Change A Dropdown Menu According To Another Menu?
I've been using QuickForm for a few months now and I am now given a
new challenge:

I've got a search form with a dozen of dropdown menus, the first
dropdown menu being "Brand". If you select either Brand A, B, C, D...
Z, the second dropdown menu "Model" must be dynamically changed to
model AA, AB, AC, AD..., according to the models manufactured by the
brand selected in the first box.

I've seen that done on quite a few sites, but never found if QuickForm
had a quick & clean way of doing that.

Board Reader
I need a meta search engine script which searches messages of several boards and shows the results of them on same page.

About Disccusion Board
well i really need a bit of help if anyone can supply.
Making a discussion board, do i store everything in Mysql regarding
the blogs and comments and also do i need encryption for security or
just simple email password?? I hav already started but just wanted to
make sure if i am on the right track...

Split The PHP Board?
It was suggested here that we split the PHP board into two boards, Basic PHP and Advanced PHP. We're just trying to judge the general opinion on that before we commit to it. Please vote in the above poll, and add a post here if you have another suggesting regarding this issue. The poll will be open until this time Friday.

Bulletin Board With PHP/Oracle
We want to build a bulletin board for our intranet and it has been decreed by the high and mighty leaders that if we use a database it must be Oracle. I want to use PhpBB or vBulletin. Has anybody out there done anything like converting stuff built for PHP/MySQL to PHP/Oracle?

Is A Graphical Drawing Board Possible?
I was wondering if it would be possible in PHP to create a "Graphical Drawing Board". What I mean by that is, I would be able to load a picture and then Draw on it with basic colored lines or drag and drop icons onto it. And on top of that for someone else on the Internet to see my drawing and to be able to add there own lines to it.

New Flash / PHP / MySQL Bulletin Board
It is with great pride that I announce the release of FlashBB, the
newest member of the TUFaT.com family of products! FlashBB is a PHP /
MySQL - driven bulletin board, sporting a sleek Flash 7 interface.

This is the first public release of FlashBB, and I've decided to make
this system 100% open-source. For just $5, you get:

1) ALL of the source code, including the Flash .FLA files.

2) FREE upgrades forever.

3) Installation instructions (they're pretty simple, included in a
readme.txt file which you willl get upon purchase)

4) My good graces.

VERY Basic Bulletin Board Needed...
...I need a very, very basic bulletin board script built, preferably using flat files, for a school project. I have no access to a mySQL database (without paying a lot more for my server annually) so as I said, flat files are preferable.

I don't even need a log in or registration.

All I'd like is a flat-file based system which allows a user to post - all it requires is 'name', 'email address' and 'subject'. It'd be sort of like a comment system, but with a customisable layout so I can make it look slightly more like a message board. They're the basics.

It'd be even better if users could post topics, but I may be pushing my luck here. If this isn't possible, then please just make it a list of messages.

I would research this and code my own, but I need this quite urgently and it could take me quite a long time, so I won't.

Free Bulletin Board Based On PHP And MySQL
I need a free bulletin board based on PHP and MySQL. For now I'm usgin XMB Forum but I want another type of board like http://www.etechkorea.info/articles/board.php .

Converting Burning Board 1.0.2 Lite To ANY Other Forum.
I'm looking to convert my WBB Lite to another forum, but there doesn't
seem to be any converters out there, any ideas?

Mail() - Message Len
Is there a length limit to the $message parm in the mail() func ?
I am doing a customer survey, with several multiline text boxes and my php code hangs when i have a couple of long comments in there. I have tried wordwrap and chunk_split, but they didn't seem to help. Any ideas?

Message Box In Java
I want to do something like bringing up a message box in Java where after
clicking OK the box disappears and processing continues.

How do I do this in PHP?

I want the processing after the message box to be conditional upon what was
used to bring up the particular message box. (I have been handling
something like this so far by having inline messages and reposting the
page.)

Send Message
I want to send a message to a user in his yahoo messenger id and MSN Id through my php script. Actually user will provide his MSN or Yahoo Id in my web form, and after
some server operation he will receive a message in MSN or Yahoo messenger.

Mail(): $message =
unsing the mail() function, I want my message to appear somewhat like this:

Hi myFriend,
thanks for coming to my site. This is what I remember of you:
group: (a var)
os: (b var)
Regards, best wishes,
Me

How do I manage to get the line breaks, and insert the vars using
[php]
$message = "Hello myFriend.....";
[/b]

Do I remove the inverted commas whenever I put a var?(for example $group).

Warning Message
I installed MySQL4.1.11 and PHP4.3.10. When trying to connect an existing
database, it showed me the following warning message which I have no idea how to
solve it.

Warning: mysql_connect(): Client does not support authentication protocol
requested by server; consider upgrading MySQL client in
c:inetpubwwwrootprojectconnection.php on line 12
Could not connect: Client does not support authentication protocol requested by
server; consider upgrading MySQL client

Error Message
On my Apache host, localhost:8080, no error message are being displayed. If
I have an error in my PHP code, all I get is a blank screen. Do I need to
configure something in Apache or PHP.ini to turn on error messages?

Send A Message
This maybe a nice little script for some new-newbies to get amongst a bit of
php action (I am still a newish-b myself)

To follow is the PHP:

<?php

$content = '
<html>
<head>
<title>test me</title>
<script src="j/j.js" type="text/javascript"></script>
<style type="text/css"> img.iletter { display: none; } </style>
</head>'

$location = $_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'];

if(($_POST["submit"] && $_POST["txt"]) || $x) {
$content .= '<body onload="reveal('l', 1, 300);" style="margin: 0px;
padding: 50px; background-color: #000;">'
if($x) {
$letters = urldecode(base64_decode($x));
}
else {
$letters = htmlentities($_POST["txt"], ENT_QUOTES);
$code = urlencode(base64_encode($letters));
$content .= '<p style="color: white;">link is :
http://'.$location.'?x='.$code.'</p>'
}
$content .= letterer($letters).'<p style="clear: both;"><br><br><a
href="go.php" style="color: white;">try another one</a></p>'
}
else {
$content .= '
<body style="margin: 50px;">
<form method="post" action="go.php">
<textarea name="txt" cols="30" rows="10">type anything you want
here</textarea>
<br><br><input name="submit" type="submit" value="show me the money">
</form>'
}

function letterer ($letters) {
$v = '<div id="letters">'
$len = strlen($letters);
for($i = 0; $i < $len; $i++){
$let = substr($letters,$i, 1);
$let = replacer($let);
$v .= '<div class="iletter" id="divl'.($i+1).'" style="float: left";><img
src="a/'.strtolower($let).'.gif" alt="'.$let.'" class="iletter"
id="l'.($i+1).'"></div>' //
}
$v .= '</div>'
return $v;
}

$content .= '</body></html>'
echo $content;

Can't Send Message
I'm filling out forms on one page, then trying to send an
email and print out the vars on the next page.

Q1: Whenever I insert the mail script, it gives me a parse error.
Please point out my syntax errors, etc.

Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or
`T_NUM_STRING' in /mypathhere/proposalconfirm.php on line 2

--script in question
<? session_start();
$msg = "x x proposal for:
$_POST['cpname'], $_POST['cptitle']
";
$msg .= " $_POST['cpcomp']
";
$msg .= " Address: $_POST['cpaddress']
";
$msg .= " $_POST['cpcity'], $_POST['cpstate'] $_POST['cpzip']
";
$mailheaders = "From: company name here
";
$mailheaders = "CC: $_POST['cpemail']";
mail("me@my.com","x x Custom Proposal",$msg,$mailheaders);
?>
<html>
--rest of script--

The printing of all vars works fine (once I removed the double
quotes from the post var callouts)

Q2: Do I need sessions to track the form vars from page to page
or am I adding unnecessary complexity to this?

My last large PHP dev work was about 2 years ago. Since then,
quick and dirty flatfile database connections (member lists)
are all I've had to contend with. Things have really changed


Posting Message
im making a forum system and i was wondering if i could have a post delay (flood control). e.g. say if user1 posted a message and then wanted to post again straight after, and then got a custom flood control message.

can i ask how would i make it so i could select how long you had to wait before posting another message and  how would i make it so i can select a custom flood control message. i would like the flood control custom message and time limit (in seconds) to be stored in a mysql table.

Message Boards
I have written a message board and it has been test properly, the problem is it looks naff in apearance. When I see this message board I would like to model it on this. I can't work out the top section. It seems to be in 3 sections pinned to top, pinned to top and read only, and the rest with the occasioal read only. I can't work out the best query. all entries will be in the same table with a field type maybee of

1=Pinned
2=Pinned read only
3=other. 

But then there is the ocasional read only.  their is one of these now 18 recs down. Any Idea on a table structure. Would it require 3 seperate queries. Not good.

Deleting A Message
I want a button to delete each message in you inbox wen clicked. im using this that doesn't work, because i coded it Code:

Loading Message.
I was wondering if there was a way to display a message while a script loads. I have a safety deposit box script, and if people have alot of items, it takes a while to load the script. So some people are sitting at a dead page for a couple seconds. So to inform them that their page is being processed, I would like to display a message while the script loads up everything from the database.

I am not aware of a function that does this, but maybe someone else does. If someone could point me in the right direction that would be great.

PHP Timeout Message?
I have a page that queries a database.  Well, often the DB goes down and the script returns the standard PHP timeout error:

Fatal error: Maximum execution time of 60 seconds exceeded in blah on line 70

Is there any way to write a custom message into the page that will display something like:

Using GET To Send Message
Im making a little live private chat system, I am not superp with javascript or ajax but I can use what i know to do this

To send a message to my server, I am using getelementbyid().value to pull out what ever they have typed in the <input field>

To send it to the server I am using ajax which will send something like this to a php file for parsing

parse.php?user=Jamie&message=What ever the have typed in the box is here&val=yes

That is working fine, I sent a message 1000 chars long and there was no hiccups
Is this ok? I mean its working.. Perhaps another way would be better? using POST with AJAX instead of GET.. although if both work..?

Error Message
after upgrading to php 5.2.1, when I try to load a php file I get the folowing error message :

Server Application Error

The server has encountered an error while loading an application during the processing of your request. Please refer to the event log for more detail information. Please contact the server administrator for assistance.

Getting Another Menu
how can I do to create another menu with the results from the options they choose?
For example, they are looking for their grades so they choose in a first menu the carreer, in other menu the grade, and then when they finish choosing the grade, It appear automaticaly in other menu all the names of the subjects concerned to te carreer and grade given.

Php Menu
How do I have The menu and the context information display at the same time? Code:

I Want To Know If An Autoresponse Message Bounces
I'm fairly new to php but am getting around. Getting too technical will lose me though.

My situation:
For every person that fills out my form for my information, (my form sends to three places) they get an immediate autoresponse message thanking them for their request. If the person has a typo in thier email address which appears to be a valid email but isn't, they don't receive this autoresponse.

My form is currently set to send a message to:
the recipient
an autoresponder system
the website owner

I want to know every time someone DOESN'T get this autoresponse message. I want the bounce message to come back to me (actually my associates where applicable) so I can see it wasn't delivered. Right now the bounce just gets lost in cyberspace.

My host told me this:

It will just be lost, the web server doesn't know who is sending the email - it will bounce to the web server, but the web server won't know who owns it and ignore it. With the correct script it could probably bounce to a known address.

I have associates who I host webpages for and I want this to work for them as well. I am able to get my messages to bounce back to me but not on my associates pages.

On my own personal form, when a person enters their information it is set to forward emails to:
the recipient
the autoresponder

And because I own the autoresponder I automatically get the response via that system as well so the third part is left out on my page. When an invalid email address is used on my form, I get the bounced message directly from the server because I own the domain.

Are there any scripts or something that I can use to catch bounced messages and send it back to the webpage owner?

How Do We Echo The Message On The Same Screen..
How do we echo the message on the same screen ( e.g. the bottom of the screen then erase the message after a while?

Sending A MIME Message
I failed to send a MIME Message with attachment file. The following code I used was crashed my Apache Webserver.

The code works if I removed the attachment 'part'.
Any clue?

note: Im running it under a Windows Platform. PHP Code:

How Do You Display A Message If There Is No Image Please
I use the code:

echo "<img src="newsimages/$five">";

to display an image taken from the database. So if there is an image the HTML becomes

<img src="newsimages/testpic.gif"> or whatever.

But if a record does not have an image, then it displays:

<img src="newsimages/"> which just brings up the missing image red cross. How can I display a message saying there is no image if there isn't one?

Decrypting An Error Message
I'm getting the following error message on a web page:

Warning: mysql_connect(): Access denied for user:
'tgsstaff@...' (Using password: YES) in
/web/tgs.gargoyles-fans.org/htdocs/experiment.php on line 9

Here's what lines 9-11 look like:

mysql_connect($host,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
echo "Has connected to database $database
";

Above it, I have variable declarations for $host, $username, and
$password.

Any help would be appreciated so I can determine the cause of the error.

Any Way To Suppress Security Message
Is there any way to suppress security messages while going in and out of https servers messages like You are about to be redirected to a connection that is not secure... Do u wish to continue..

Output Message And Redirection
I have a link to a page that executes a perl script to generate an Excel Spreadsheet, then it outputs this using Header(). How would I tell the user to be patient while the script executes? (Obviously, I can't do it on this page because whitespace will be output before the headers). I need something similar to the search function message on this actual forum. PHP Code:

HTML Message Problem
I have a newsletter that has the ability, to send either HTML or Text newsletters. Here's the thing, when I press the HTML option, and I put in HTML code, all the email addresses, get the HTML code, not the output. In the mail() function, I use this:

$headers = "Content-type: text/html; charset=iso-8859-1
";

So that it can send HTML, but still it only shows the HTML code instead. What's wrong, and how can I fix it?

Displaying Error Message
I've got a problem. I need to display an error message when unable to find a record. Below is one section of the code I'm working on. Code:

Getimagesize ( ) Error Message Please Help!
What is with this error message?????? First part validates, second part
fails...

getimagesize (filename...) failed to open stream: No such file or directory

} elseif ($photo) {

$ext = strtolower(substr($photo, -3));

if ($ext == "peg") { $ext = "jpg"; }

if ($ext != "gif" && $ext != "jpg" && $ext != "jpeg" && $ext != "bmp" )
{

$focus = "photo";
$msg2 = "Please provide a valid gif, jpeg, or bmp photo or do not
attach one.";

} else {

$size = getimagesize($photo);

if ($size > 25000) {

$msg2 = "Photo must be smaller than 25k.";

}}}


Copyright © 2005-08 www.BigResource.com, All rights reserved