| Coding Forum Problems with your code? Let's hear about it. |
08-18-2004, 02:14 PM
|
#1 (permalink)
|
|
v7n Mentor
Join Date: 03-04-04
Location: Whycocomagh, Nova Scotia
Posts: 4,763
|
Help with phpbb
I've received an offer from a potential advertiser to place 750+ unique, static links on my site. I'm running a phpbb forum (my photography forum), and was wondering how I would go about placing static links on any given forum page? I can't put it in the header or the footer... it has to go in each thread, I would assume...
Any ideas?
|
|
|
08-18-2004, 02:49 PM
|
#2 (permalink)
|
|
No Longer Here
Join Date: 09-27-03
Location: State College, PA
Posts: 9,354
Latest Blog: None
|
What about putting it in viewtopic_body.tpl?
|
|
|
08-18-2004, 02:50 PM
|
#3 (permalink)
|
|
No Longer Here
Join Date: 09-27-03
Location: State College, PA
Posts: 9,354
Latest Blog: None
|
I don't think there is a way to pick and choose just certain threads.
|
|
|
08-18-2004, 02:50 PM
|
#4 (permalink)
|
|
v7n Mentor
Join Date: 03-04-04
Location: Whycocomagh, Nova Scotia
Posts: 4,763
|
But that would just put 1 link in all the topics... I need to put 750 unique links... 
|
|
|
08-18-2004, 02:51 PM
|
#5 (permalink)
|
|
No Longer Here
Join Date: 09-27-03
Location: State College, PA
Posts: 9,354
Latest Blog: None
|
Oh. So each link is something different? I'm pretty sure you can't do that.
But, someone else here probably knows better than me.
|
|
|
08-18-2004, 02:59 PM
|
#6 (permalink)
|
|
v7n Mentor
Join Date: 03-04-04
Location: Whycocomagh, Nova Scotia
Posts: 4,763
|
Yeah, basically each link will link to a different product... it's a long-term advertising commitment, so I don't mind doing each one individually, but I just have to figure out a way to do it...
|
|
|
08-18-2004, 03:05 PM
|
#7 (permalink)
|
|
No Longer Here
Join Date: 09-27-03
Location: State College, PA
Posts: 9,354
Latest Blog: None
|
What about some sort of link randomizer placed on every page?
|
|
|
08-18-2004, 04:28 PM
|
#8 (permalink)
|
|
v7n Mentor
Join Date: 03-04-04
Location: Whycocomagh, Nova Scotia
Posts: 4,763
|
They don't want it randomized... the want a hard link on each page...
|
|
|
08-18-2004, 04:52 PM
|
#9 (permalink)
|
|
Inactive
Join Date: 10-20-03
Location: United Kingdom, London
Posts: 2,207
Latest Blog: None
|
Add it in your sig?
|
|
|
08-18-2004, 04:55 PM
|
#10 (permalink)
|
|
v7n Mentor
Join Date: 03-04-04
Location: Whycocomagh, Nova Scotia
Posts: 4,763
|
But they want a different link on each page, to 750+ different products...
|
|
|
08-18-2004, 05:36 PM
|
#11 (permalink)
|
|
Contributing Member
Join Date: 10-13-03
Location: Pffffft
Posts: 8,857
Latest Blog: None
|
They better be paying you a hell load a money, I would never do that, unless they pay good 
|
|
|
08-18-2004, 05:45 PM
|
#12 (permalink)
|
|
Inactive
Join Date: 07-06-04
Location: Detroit, MI
Posts: 594
Latest Blog: None
|
You could probably create a new entry into the database, then using the thread ID to decide which product displays on which page.
You'd have to add every item to the databse, and then pick which threads you want them displaying on, but It might work.
I couldnt do it myself since I suck with php/databases. But its probably possible.
|
|
|
08-18-2004, 06:15 PM
|
#13 (permalink)
|
|
v7n Mentor
Join Date: 03-04-04
Location: Whycocomagh, Nova Scotia
Posts: 4,763
|
Hmmm... yeah, it might have to be done that way... grrr. what a pain. They've offered quite a bit of money for it, though, so it would probably be worth it... any idea who could maybe do something like that for me?
|
|
|
08-18-2004, 07:32 PM
|
#14 (permalink)
|
|
v7n Mentor
Join Date: 03-04-04
Location: Whycocomagh, Nova Scotia
Posts: 4,763
|
I would be willing to pay someone to set it up for me (and i don't mind entering all the info myself)... $$$$. 
|
|
|
08-18-2004, 11:39 PM
|
#15 (permalink)
|
|
Inactive
Join Date: 06-20-04
Location: Ontario
Posts: 3,359
Latest Blog: None
|
The way I see it the hardest part is deciding about the logic of ad placement.
You say they don't want it randomized, but if not then what is their take on how the ads should be placed? What decides that this ad goes to that thread, but the other thread shows a different ad? They surely must have some sort of algo in mind.
Another question is the relation between the number of threads and the number of adds. I took a look at your pages and I can see some ads there. Looks like there are 4 links per thread (right below the navigation buttons). Are these already a part of the deal, or are we talking about a different set of ads.
Back to the relation. This is a simple proposition of the logic for ad placement.
Say you have 700 ads, but way more topics. One approach could be this:
1. each topic has a unique ID
2. each ad could be placed in a database and would also be assigned an unique ID (from 1 to 700)
3. topic #1 gets ad #1, topic #2 gets ad #2 and so on untill you reach the number 701.
4. When the topic # is >=701 then you do this algo:
[code:1:2f94626c55]integer TN //current topic number
integer NA //total number of ads
integer AD //ad to display
if NA = 0 then
exit //division by zero, and no ads to show
if TN <= NA then
AD = TN
else
AD = TN mod NA
if AD = 0 then //do this condition if ad counting
AD = 1 //starts from 1, not 0
[/code:1:2f94626c55]Example:
Assume that
Total Number of ads is 700
ID of topic to display is 701, so
(701 mod 700) = 1
ergo, topic with ID 701 will show ad #1
another one (just playing here):
Assume that
Total Number of ads is 700
ID of topic to display is 12345, so
(12345 mod 700) = 445
ergo, topic with ID 12345 will show ad #445
With just a few keystrokes this algo could be modified to provide for the display of more than one ad, the way you do it now.
Note:
If the number of topics remains static (700) then a thread will always show the same ad. Logically, it follows that every time an add is added to, or removed from the database, some threads will no longer show within the topics where they did before. This will concern mostly topics whose numbers (or even multiples of numbers) are within the range of the change in the number od added/removed ads. Sounds complex, but really isn't. I guess my English is failing me here.
Anyway, what I suggested above is not randimizing, so the placement of ads is predictable.
<edit: supplemented to provide for AD = 0, and spelling too>
|
|
|
08-18-2004, 11:56 PM
|
#16 (permalink)
|
|
v7n Mentor
Join Date: 03-04-04
Location: Whycocomagh, Nova Scotia
Posts: 4,763
|
Wow... thanks for that. I think I follow what you mean, and I think that would work... now the question is, how would I make it work? From what I understand, they're not picky about which ads go where, as long as they're in different threads (all about the anchor text link)...
|
|
|
08-19-2004, 12:03 AM
|
#17 (permalink)
|
|
Inactive
Join Date: 06-20-04
Location: Ontario
Posts: 3,359
Latest Blog: None
|
well, the design is not finished yet. Remember no coding before design is complete?
You need to decide about the storage format of the ads. Database items? Individual files?
For both database and file storage the general design would require files probably numbered, or database table structured according to some logic, for instance (lines in each file, or fields in the table for each ad record):
1. ad number
2. add contents (HTML code etc)
3. link
You also ned to decide how ads are shown. What format? Within a table? How many cells, lines etc.
Once you got that then the road is clear and PHP coding may commence 
|
|
|
08-19-2004, 12:12 AM
|
#18 (permalink)
|
|
Inactive
Join Date: 06-20-04
Location: Ontario
Posts: 3,359
Latest Blog: None
|
Just a side note which is a result of thoughts on MySQL. This topic clearly shows how MYSQL sucks. Should a true database system be used (Postgres, Firebird, or some of the commercial ones) then it would be a question of perhaps 5 to 10 lines of code to create an appropriate trigger, internal to the actual database. Such trigger could automatically insert a topic or a post in appropriate threat using more or less the logic shown in my prior post.
Oh well, maybe one day.
|
|
|
08-19-2004, 12:53 AM
|
#19 (permalink)
|
|
v7n Mentor
Join Date: 03-04-04
Location: Whycocomagh, Nova Scotia
Posts: 4,763
|
Hehe... well, all the ad is, is a link with anchor text. Does that make it easier?
|
|
|
08-19-2004, 06:54 AM
|
#20 (permalink)
|
|
Inactive
Join Date: 06-20-04
Location: Ontario
Posts: 3,359
Latest Blog: None
|
Yes, less typing for data entry 
|
|
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
| |