Previous Thread
Next Thread
Print Thread
Rating: 41
Page 2 of 11 1 2 3 4 10 11
Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
In reply to:


oh and Dave xhtml is your friend





LoL I know I know

When I get things moved to templates I'll work on making the needed changes for xhtml compliancy

Sponsored Links
Joined: Oct 2000
Posts: 2,667
Veteran
Veteran
Offline
Joined: Oct 2000
Posts: 2,667
oh and there is a bug with the URL used for the pal images (not the right one)


Do you believe in love at first sight,
or should I walk by again?
Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
hmmmm I thought I had gotten all of the variables switched to the new variable $url2palimagesDirectory in the scripts that called the images out of that directory. I'll make sure to go over them again. Thanks.

Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
Looking things over I believe I can make the index catagory based but I'm not going to pull the catagory name out for display anywhere as this would require an additional query (something I'm trying to condense) but I can limit the board information to what ever catagories are given.

I'm going to try and use a table join to pull the catagory name and description out so it could be used at some point on the index. I'll let you know what happens.

Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
I can assist with that (the xhtml, when you are ready) if you like


- Allen wavey
- What Drives You?
Sponsored Links
Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
Thanks!

I'll give it a good shot when putting the templates together but I'm sure it will need need work after it's done. lol (wouldn't be fun if there wasn't nothing to fix)

Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
I don't think the "Hot Topic" pal box is working correctly yet. Also the "Current Poll" box is pulling a poll in from a reply. I will have to look but I had thought I had limited this to the main post and not the replies.

I'll be looking that over too. It's going to be a long night. LoL

Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
Forgot to say earlier I have also managed to remove the table join in the poll pal which was used to get the board's title and still display the title. (helped speed things up a tad)

I shaved 1 query per board being displayed in the center column for news/articles. Sites displaying 3 or 4 boards will soon be able to save 3 or 4 queries in that area.

Ok back to work...

Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
I have the IIP displaying according to catagory now.

Some pal boxes such as Current Threads, Top X Threads and Top X Rated Posts work well. The news/article section doesn't work as well as these boards are pre specified in the configpal.php script and based on the viewer's groups as a whole. If a user who can view information located in catagory 1 and 2 but access the index page using catagory 2 and the news is in catagory 1 they will still see the information because they have the access.

I think I can get this to reflect catagory specific boards in the news section so that each catagory could have it's own news/article board.

Joined: Feb 2002
Posts: 2,286
Veteran
Veteran
Joined: Feb 2002
Posts: 2,286
Nice one - I look foward to giving this modified version a tryout, when you release it.

Thanks again.

Ian


Fans Focus - Focusing on Fans of Sport

(Okay - mainly football (the British variety wink at the moment - but expanding all the time....)
Sponsored Links
Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
I guess I didn't make pollpal pull the information from *only* the main posts. It also seaches replies. Should I change this so that it does? This will make for shorter searches into the database for the poll information? That could also speed things up a bit. (it all helps)

Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
Sounds like a good idea dave. I imagine most people who want a poll on the front page would start a new thread to use that in

I think I'll change our poll forum to "chit chat" so people can test polls in the test forum and we won't have them on the front page


- Allen wavey
- What Drives You?
Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
Yep I done decided about 2 minutes after posting that question that I'll keep it to the main post because otherwise the "x comments" wouldn't reflect the thread.

Also I found an error where random polls may count unapproved posts when setting up the number to pick the random poll from. This may be a cause of a blank poll.

Joined: Apr 2002
Posts: 30
User
User
Offline
Joined: Apr 2002
Posts: 30
Heyya Dave.

I have been playing with your new IIP on a 5.5.1 board, and ran into a problem with the randprofilepal.php.

In the 5.5.1 database, U_Number is generated with auto_increment, and when you delete a user, that number is not re-used.

What happens then is this: Say I have user numbers 1, 2, 3, 4. I delete user 4. Then someone else registers, and they are assigned User ID 5. Now I have Numbers: 1, 2, 3, 5.

randprofilepal.php is looking at $palshowregs to get the number of users registered. In the above example it would return a value of "4". Now there is no user ID for the number 4. That means that 25% of the time, randprofilepal.php will fail, and simply not be displayed. Also, user ID "5" will never be displayed.

I believe I have fixed the problem by letting MySQL perform the rand function. There may be a more efficient way to do this, but this worked for me.

I changed the following syntax in randprofilepal.php:

Find this in randprofile.php:
code:

if ($palShowregs != 0) {
$profID = rand(2,$palShowregs);
}
$profID_q = addslashes($profID);


And change to this:
code:

$query = "
SELECT U_Number
FROM w3t_Users
ORDER BY RAND() LIMIT 1
";
$sth = $dbh -> do_query($query);
list ($profID_q) = $dbh -> fetch_array($sth);
$dbh -> finish_sth($sth);


Anyone see any problems with that? It adds another query on the database, but it is the only way I can see to get around this particular bug.

I dont know if this affects board running 6.0 since that is what randprofilepal.php was written for anyway . But if you are thinking of making a backwards-compatible version of IIP, that is one bit of code that you might need to look at.

Thanks again for the great mod Dave! IIP really helped to improve user participation on my board.


Paul Fries
Systems Administrator
CWIE LLC
Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
The MySQL database that my host supplies does not offer a random ability. Or at least the last time I tried it failed.

I hadn't thought about the fact that it could select deleted users though. Thanks for letting me know. I'll see what I can put together to fix that.

While on the random subject, I had found another problem with the random poll. I think it was already there but I may have caused it while removing the javascript to an external file along with the text to language file. I'm fixing it right now.


Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
Ok I think I found a way around this without having to add another query to the database.

Replace this:
code:

if ($palShowregs != 0) {
$profID = rand(2,$palShowregs);
}
$profID_q = addslashes($profID);

$query = "
SELECT U_Picture,U_Bio,U_Name,U_Username,U_Location,U_Hobbies,U_PicWidth,U_PicHeight
FROM w3t_Users
WHERE U_Number = '$profID_q'
";



With this:
code:

if ($palShowregs != 0) {
$RandNum = rand(2,$palShowregs);
}
$query = "
SELECT U_Picture,U_Bio,U_Name,U_Username,U_Location,U_Hobbies,U_PicWidth,U_PicHeight
FROM w3t_Users
WHERE U_Number >= 2
LIMIT $RandNum,1
";



I think that should do it. Let me know otherwise.

Joined: Feb 2002
Posts: 2,286
Veteran
Veteran
Joined: Feb 2002
Posts: 2,286
Dave,

I'm confused

What is the most recent version of this?

Ian


Fans Focus - Focusing on Fans of Sport

(Okay - mainly football (the British variety wink at the moment - but expanding all the time....)
Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
Right now it's 4.3 but give me a couple weeks and I should feel comfortable enough and have gotten enough completed on my list of things to do and I'll kick 5.0 out the door.

Things to look forward to are a Shout Box, Profile Index and Picture Posts. Oh and easier on the database too...

Did I mention templated? LoL

Joined: Apr 2002
Posts: 30
User
User
Offline
Joined: Apr 2002
Posts: 30
Dave,

Unfortunately, randprofilepal.php still seems to be selecting invalid user IDs with that code. I had tried something similar before doing another database call, but had no luck.

The problem seems to be caused because we are depending on the value returned by $palShowregs. This number is the number of users in the database, but that does not necessarily correspond with the U_Number for each user (at least in 5.5.1.. Not sure about 6.0).

For example: It is possible in 5.5.1 (if you delete a lot of users) to have 4 users in your database with the numbers: 1, 5, 8, 10. Now $palShowregs will tell you that you have 4 registered users, and that is correct, but if you tell randprofilepal.php to display a $RandNum between 1-4, you will only cover one of those user IDs.

I have noticed a similar problem (I think it is similar at least ) with pollpal.php. If you delete a poll, pollpal.php will still try to call it. However, because there is no data for the poll, it will just display the text: Out of "".

I believe the pollpal.php problem can be fixed by simply modifying the select statement to make sure that certain rows are not null. I haven't played with it yet though.

-Paul


Paul Fries
Systems Administrator
CWIE LLC
Joined: Apr 2002
Posts: 30
User
User
Offline
Joined: Apr 2002
Posts: 30
I believe that the problem with pollpal.php is probably more of a problem with doexpirethreads.php.

If you create a thread that contans a poll in it, then delete that poll (not the whole thread, just the post containing the poll) the Poll Number is still contained in w3t_Posts.B_Poll.

This means that pollpal.php (and polllistpal.php) will still see it as a valid poll, and try to display it.

I thought of adding an update query to doexpirethreads.php to delete the data in B_Poll when you delete the post, but I am not sure how that would affect threads with multiple polls in it.

-Paul



Paul Fries
Systems Administrator
CWIE LLC
Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
I have pollpal using *only* the main post now. If the main post is deleted and it had a poll in it it will no longer be readable as related poll data is also deleted.

Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
The random profile no longer selects according to UID corrosponding to the random number generated. What it does is generate a random number from the total number of users.

If there are 20 people in the database, counting the built in user #1 I would have to take a random number from 19 as the built in user doesn't count. Now that I have the total number of users I can select from I set up the query to use that random number for the limit argument and not as the UID number. If the random number was 15 the query would select the row 1 total record starting at row 15.

code:

if ($palShowregs != 0) {
$RandNum = rand(2,$palShowregs);
}
$query = "
SELECT U_Picture,U_Bio,U_Name,U_Username,U_Location,U_Hobbies,U_PicWidth,U_PicHeight
FROM w3t_Users
WHERE U_Number >= 2
LIMIT $RandNum,1
";




I have changed this line:
$RandNum = rand(2,$palShowregs);

To this also:
$RandNum = rand(0,$palShowregs);

as there was no reason to be starting from 2 as the query's format avoided user number 1 anyhow. This should work but it's not efficient as the code you stated earlier.

I have been doing some reading and in MySQL version 3.23 and higher this is a valid query:

SELECT * FROM TableName ORDER BY RAND() LIMIT 1

This is exactly the same query you came up with. I think when I had tried using it last I may have had it set up wrong or something so I'll try it again. I'm pretty sure I have at least 3.23 for a database. (I hope)

Using MySQL to do the random selection is probably more efficient too so this will be the way to go.

Thanks for your input/feedback. It realy helps!

Joined: Aug 1999
Posts: 184
Member
Member
Offline
Joined: Aug 1999
Posts: 184
Is there any way we can get an updated zip file for this? I just upgraded to 6br2 and want to start incorporating it.

Thanks


Silly ricer.. Wings are for airplanes!
Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
At this time 4.3 at the front is the most up to date. I don't have anything ready otherwise. Sorry.

Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
I can't use mysql to make the random selection.

I still have mysql < 3.23 but I am planning on switching to a new host soon so maybe then I'll be able to use the random query.

Joined: Aug 1999
Posts: 184
Member
Member
Offline
Joined: Aug 1999
Posts: 184
OK Did the install, it went 'ok', but it does not seem to be using any kind of themes for me. http://www.theddz.com Nor will it allow me to login and stay logged in.

Last edited by ExcelsiorDDZ; 05/07/2002 8:47 PM.

Silly ricer.. Wings are for airplanes!
Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
Are your cookies site wide?

Joined: Aug 1999
Posts: 184
Member
Member
Offline
Joined: Aug 1999
Posts: 184
They are, but I found that the main page is looking for www.theddz.com/stylesheets/ddz2.css rather than www.theddz.com/forums/stylesheets/ddz2.css


Silly ricer.. Wings are for airplanes!
Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
That's odd. The index page uses the same send_header function that the rest of the threads package uses. Should have been the same for all...

Joined: Aug 1999
Posts: 184
Member
Member
Offline
Joined: Aug 1999
Posts: 184
this is your source view...

<link href="/imp/style.cgi" etc...

this is mine..

<link href="/stylesheets/ddz2.css" etc..


Silly ricer.. Wings are for airplanes!
Joined: Aug 1999
Posts: 184
Member
Member
Offline
Joined: Aug 1999
Posts: 184
I feel SO stupid!!!!!!!!!


"Absolute URL containing the stylesheets for the program" needs the 'absolute' path rather than just '/stylesheets'

All fixed. Now off to editing


Silly ricer.. Wings are for airplanes!
Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
But the stylesheet link is governed by UBBT. What ever threads is using for style sheets is what is used for the index page. The index page does not add any html till after the UBBT menu bar. That's why I can't understand how it could be specifying a stylesheet link at all...

Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
Disregard my last post... lol I didn't read on to your next one.

Joined: Aug 1999
Posts: 184
Member
Member
Offline
Joined: Aug 1999
Posts: 184
heheh, OK. I will work on the cookies thing tomorrow I guess. Its still not allowing me to login.

Another thing... The popular posts, top threads, etc needs to check and see if that person can even see that section. I have private forums and this would be of great concern for me.


Silly ricer.. Wings are for airplanes!
Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
In reply to:


The popular posts, top threads, etc needs to check and see if that person can even see that section. I have private forums and this would be of great concern for me.





Everything that is post related is displayed according to group access.

Joined: Aug 2001
Posts: 128
Member
Member
Joined: Aug 2001
Posts: 128
Image issues... Dave... OK I just upgraded from 4.2 to 4.3 and you have the variable in for where the images are located but in the code for like say the rand profile and stuff it doesn't use that variable. Might wanna fix this in next release...

Joined: Aug 1999
Posts: 184
Member
Member
Offline
Joined: Aug 1999
Posts: 184
Try Ctrl-Refresh on the page. That worked for me.

Also I figured out my logging in problem....

I was using forums.theddz.com, but when I changed it to www.theddz.com/forums in the UBB.t config, the login for PAL works great now.



Silly ricer.. Wings are for airplanes!
Joined: Aug 2001
Posts: 128
Member
Member
Joined: Aug 2001
Posts: 128
Nope wont work... still reading the code correctly... The code is wrong is the problem... Also the code for viewing the profile's pic is wrong... it has the /pals/palimage/ hard coded in... my images are in /images...

Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
I have made it so all pal related images are located in the pals directory on purpose.

Joined: Aug 1999
Posts: 184
Member
Member
Offline
Joined: Aug 1999
Posts: 184
I remember now. I changed mine to the hard coded location for the images.


Silly ricer.. Wings are for airplanes!
Page 2 of 11 1 2 3 4 10 11

Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
isaac
isaac
California
Posts: 1,157
Joined: July 2001
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20221218)