Previous Thread
Next Thread
Print Thread
Rate Thread
#101497 10/17/2000 11:43 PM
Joined: Sep 2000
Posts: 5
Junior Member
Junior Member
Offline
Joined: Sep 2000
Posts: 5
I'm writing a script to do random signatures for the ubb board. They way it works is, the program searches the signature for the string "[RANDOM]" then replaces it with a phrase randomly chosen from a text file.

The problem is that it seems to add posts by unregistered users with the name "6" or "reg" or "reh" at the beginning of the thread and posts by unregistered users with no name afterwords. ALso, in the post, only the first line of the text file is ever used, and other text in the sig disappears.

I've narrowed it down to somwhere in this bit of code:

Code
code:

any ideas? Sorry if it's a bit of a bad description.. not thinking clearly right now..

------------------
Programming today is a race between software engineers striving to
build bigger and better idiot- proof programs, and the Universe trying
to produce bigger and better idiots. So far, the Universe is winning.

Sponsored Links
Joined: May 2000
Posts: 243
Member
Member
Offline
Joined: May 2000
Posts: 243
I have a question. Are all the random signatures on one file? or are they on seperate files? That $SigFile variable makes me think you have it on seperate files. I think i'd be better to have them on one file.

------------------
My Site

My Board

Joined: Sep 2000
Posts: 5
Junior Member
Junior Member
Offline
Joined: Sep 2000
Posts: 5
not quite sure what you mean by the question?

All of the different signatures for a particular user are in one sig file. Each user has their own file.

the $SigFile variable just defines the name of the file, which is based on the user's number. (000000002.ran, or somesuch)

------------------
Programming today is a race between software engineers striving to
build bigger and better idiot- proof programs, and the Universe trying
to produce bigger and better idiots. So far, the Universe is winning.

Joined: May 2000
Posts: 243
Member
Member
Offline
Joined: May 2000
Posts: 243
Oh, I see a problem

return @UserSigs[$num];

should be

return $UserSigs[$num];

------------------
* My Site
* My Board
* = No longer exist!

Joined: Aug 2000
Posts: 3,590
Likes: 1
Moderator
Moderator
Offline
Joined: Aug 2000
Posts: 3,590
Likes: 1
zanardi -- I don't believe that is the problem. I believe you can call it with the @, but it is bad coding technique. In fact, I believe that the UBB does that somewhere in the its coding...

NightHawk The Sane -- Care to zip up the entire script and email it to [email protected]? I can take a look at it and see where the problem is.



------------------
Da Wannabe Cannuck

:: Who is Andy?

Sponsored Links
Joined: Sep 2000
Posts: 755
P.I.T.A. / Programmer
P.I.T.A. / Programmer
Offline
Joined: Sep 2000
Posts: 755
Quote
quote:
That and it's just plain wrong.

$blah[something] is an array element
@blah[something] is an array slice.

While it's possible to get the same result with using either, it's not a good idea. It's a good idea to read up on the differences.

--mark


"Annnnnnnndd now, opening for Iron Maiden...... WYLD STALLYNS!!!" --Bill S. Preston, Esquire and Ted "Theodore " Logan
#101503 10/24/2000 10:17 PM
Joined: Sep 2000
Posts: 5
Junior Member
Junior Member
Offline
Joined: Sep 2000
Posts: 5
yea, the @ is bad coding, I know that.
But that's not the problem [Linked Image]

atom, sorry for the delayed response, thank's for your help. I'll email what i have to you right now...

------------------
Programming today is a race between software engineers striving to
build bigger and better idiot- proof programs, and the Universe trying
to produce bigger and better idiots. So far, the Universe is winning.


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:
Shock Hosting
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
isaac
isaac
California
Posts: 1,153
Joined: July 2001
Forum Statistics
Forums63
Topics37,583
Posts293,955
Members13,825
Most Online151,614
Nov 14th, 2025
Today's Statistics
Currently Online 38365
Topics Created 0
Posts Made 0
Users Online 1
Birthdays 2
Top Posters
AllenAyres 21,080
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,834
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-2026 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.1.0
(Snapshot build 20260108)