473,769 Members | 6,203 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Pagination error in phpbb - desperate for help

I've posted my query at the phpbb forum, where I got half an answer and then
no more. I posted it again at another phpbb forum, where I got half an
answer and no more. I posted it in alt.php, where I got half an answer, then
no more.

In desperation, I'm now posting again in alt.php, alt.comp.lang.p hp and
comp.lang.php in the hope that someone will find the time to help.

This was my original query:

*****
I've got 5 Categories, 20 forums in all.

Three of them show "Page 1 of 0" at the bottom and "GotoPage" at top and
bottom. The forums are all very lightly populated with posts - two have only
one post each, one has four.

I've tried re-synching them, but no good.

They were all forums where some previous posts were created and then deleted
when testing the board before going live - could this be part of the
problem? Will it correct itself when a certain number of posts have been
made into them? Is there anything I can do now to correct it?

*****

The first (and only) reply I got was:

***

if you have deleted the posts manually using sql query, then you haev to
update the phpbb_forums table too, where it keeps track of the number of
posts and topics, try changing that and see

***

To which I replied:

*****

The posts were deleted using the Moderator Control Panel. Don't know if
that's what you mean by deleting them manually using sql query.

I've just installed phpMyAdmin, and can now see a host of features new to
me. Rather confusing. I've only been using php for a month. Can you suggest
what I should do to update the phpbb_forums table? I assume it's something I
can do in phpMyAdmin.

*****

To which there was no further reply. At the other forum, where I posted the
same original question, I was asked what software versions I was using. I
provided the answers. No further reply.

I'm using:

phpbb 2.0.6
phpMyAdmin 2.5.4

My ISP is running:

php 4.3.2
MySQL 4.0.15a

The first reply I got in alt.php was:

"And have you tried updating the phpbb_forums table then?"

To which I replied:

"Well, that's what I'm asking - how to do this. So the answer's no. Because
I don't know how to. How would you do it?"

The reply was:

***** *****

I don't have to do it, cause i wrote my own forum ;)

But anyway, i'm bored so i download the phpBB2 source.

First i looked under the db directory but that seems to contain database
astraction layer implementations .

Then i thought, hey, the man is having problems with the forum view, so i'll
have a look viewforum.php The first thing i read in that code: $sql =
"SELECT * FROM " . FORUMS_TABLE . " WHERE forum_id = $forum_id"; Bingo! this
must be the right place.

A little further i notice (line 246): $sql = "SELECT COUNT(t.topic_i d) AS
forum_topics FROM " ...
I wonder: Do they know about JOIN? Hell, it's their code.

I guess includes/funtions_post.p hp is a good start, cause here you can read
what happens when someone posts. Upto you to find out which tables/rows
haven't been updated.

Next i really would like to know about their databasedesign, and i end up in
install/mysql_schema.sq l.

Have a look at the phpbb_forums table, cause my guess is that there you need
to change some values.

Darn they alreay said that at phpbb, so i'll be more precise: Have a look at
following columns of the table because here is where your problem is:

forum_status tinyint(4) DEFAULT '0' NOT NULL,
forum_order mediumint(8) UNSIGNED DEFAULT '1' NOT NULL,
forum_posts mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
forum_topics mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,

So what you need to do:
(Make a backup of your database, so you don't feel like killing me in case
something goes wrong)

Foreach forum in phpbb_forums:
-) Get the number of posts that belong to a forum from phpbb_posts
select count(*) as count from phpbb_posts where forum_id=$forum _id
update phpbb_forums set forum_posts=$co unt where forum_id=$forum _id
-) Get the number of topics that belong to a forum from phpbb_topics
select count(*) as count from phpbb_topics where forum_id=$forum _id
update phpbb_forums set forum_posts=$co unt where forum_id=$forum _id

Done.

***** *****

To which I replied:

***** *****

Thanks for taking the time to reply.

Unfortunately, I'm still not clear on *where* I'm supposed to do what you
advise me to do, or how to go about it.

When I log into to my database using phpMyAdmin, I can see "phpbb_foru ms"
listed amongst the files in the left-hand frame. When I click it, in the
main frame I see "Database [mydatabasename] - Table phpbb_forums running on
[servername]". The selected tab at the top is "Structure" . There's a list of
21 fields, including the four you mentioned -

forum_status tinyint(4) DEFAULT '0' NOT NULL,
forum_order mediumint(8) UNSIGNED DEFAULT '1' NOT NULL,
forum_posts mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
forum_topics mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,

Down the bottom of the frame I see a text input box titled "Run SQL
query/queries on database [mydatabasename]". In the input box it says:

"SELECT * FROM `phpbb_forums` WHERE 1"

and this looks similar to the syntax you've used - so is this where I type
in the instructions you've provided? That is to say: do I type in -

select count(*) as count from phpbb_posts where forum_id=$forum _id

- and click "Go"?

Do I then type in the next line of your advice -

update phpbb_forums set forum_posts=$co unt where forum_id=$forum _id

- and click "Go"?

Do I follow this with -

select count(*) as count from phpbb_topics where forum_id=$forum _id

- and click "Go", followed by -

update phpbb_forums set forum_posts=$co unt where forum_id=$forum _id

- and click "Go"?

Sorry to be so dense, but php and SQL is very new to me.

***** *****

No further reply has been forthcoming.

Please - any help in clarifying what I must do and how I should do it will
be much appreciated.

Thanks.

BK
Jul 17 '05 #1
0 2070

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1892
by: Somerset Bob | last post by:
I've posted my query at the phpbb forum, where I got half an answer and then no more. I posted it again at another phpbb forum, where I got half an answer and no more. I posted it in alt.php, where I got half an answer, then no more. In desperation, I'm now posting again in alt.php, alt.comp.lang.php and comp.lang.php in the hope that someone will find the time to help. This was my original query:
2
2954
by: Somerset Bob | last post by:
I've got pagination errors in a phpBB board. Some forums are showing "page 1 of 0". Previous enquiries both here and at the phpBB forum have given me half-answers, the latest of which contained this advice: For each forum in phpbb_forums: -) Get the number of posts that belong to a forum from phpbb_posts select count(*) as count from phpbb_posts where forum_id=$forum_id update phpbb_forums set forum_posts=$count where...
2
2329
by: Chris H | last post by:
I am having a problem with pagination, basically the problem is happening in the "PREV / NUMBERS / NEXT" links, it appears as if the reason is becasue the increment and decrement operators aren't functioning or the $page variable isnt working in that part of the code... Below is the link to the working but broken page.. as well as the main part of my code... Hopefully someone can explain why the operators arent working or maybe see what i...
11
2782
by: ste | last post by:
Hi there, Further to my recent posts where I've received excellent help from Rik and Jerry, I've ended up with an image gallery on my website that displays images in a table, 3 images per row. This works great and opens all images in the database when I open the url mywebsite/gallery.php, or I can choose certain images (by category) by going to url's like mywebsite/gallery.php?category=landscape Although the above worked perfectly...
1
7181
by: selvamcbe | last post by:
sir I have a problem with installtion of phpbb 2 Forum in my website... I am having a website named http://www.clickonlinejobs.com Also i plan to include forum with it.So i have added my forum in my sub domain named http://www.forum.clickonlinejobs.com... Here is the steps what i done for installation 1.Based on Flash video tutorial which available in http://www.phpbb.com i copied my extracted phpbb files into my sub domain which...
1
6851
by: shalini jain | last post by:
Hi, I want to know how can we do pagination using XSL. There are number of tutorials available on pagination using PHP but nothing with XSL. i am really stuck with my code. Below is the code that i have written for pagination but it displays the link of all the pages at one go i.e. if i have 8 pages showing 10 results per page than it shows links for all 8 pages. Previous 1-10 11-20 21-30 31-40 41-50 51-60 61-70 71-80 Next i want to...
9
32502
by: simple12 | last post by:
Hello I have a script which have the facility of entering any code to some part of a webpage. I have some problems with it. When i put some code in the script then their is no error shown. When i try to not use a code and leave it empty the following php errors happens. I dont understand why. Help me. Error shown are: - PHP Notice: in file /index.php on line 132: Undefined offset: 4 PHP Notice: in file /index.php on line 141:...
16
2780
by: gnawz | last post by:
I have a pagination function I am using in a file called functions.php as below<? //Pagination functions function getPagingQuery($sql, $itemPerPage = 10) { if (isset($_GET) && (int)$_GET > 0) { $page = (int)$_GET; } else { $page = 1; } // start fetching from this row number $offset = ($page - 1) * $itemPerPage; return $sql . " LIMIT $offset, $itemPerPage"; } /* Get the links to navigate between...
2
2594
by: kkshansid | last post by:
this is my search page on which i am getting two parameters from previous page but the problem is that as soon as i click any other next pages my sql query fails as it doesnt get these two parameters kindly help <?php session_start(); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title></title>
0
10211
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10045
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9994
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9863
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8872
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6673
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
3959
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3562
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2815
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.