Jump to content

integrating 3rd party info into database search results display


rhock_95

Recommended Posts

I'm thinking this can be done script-side rather than in the database itself...

 

here's what I need help with...I have a script that displays a list of contacts when a category is selected...the results are displayed in a list with pagination ... a typical row (display code) looks like this:

 

echo '  <td>'.$data['phone'].'&nbsp</td>';

 

What I would like to do is is have a "Google AdSense" text ad be displayed after X amount of displayed rows...can I use php to include() the Adsense code in this manner?...If this is possible, can someone post an example of how the display counts the rows and includes the ad file.

 

 

 

 

Link to comment
Share on other sites

I don't know how your code is setup-my code was an example of how to do it. If you remove the last curly brace from my example you don't close out the while loop. As far as google is concerned I know nothing but,  you have to sign up for it and then you can get code to embed.

Link to comment
Share on other sites

is this something to be used on it's own or in conjunction with the previous replies?

 

sorry I have no idea how to implement this with my script...I am not a php coder...just a poor site admin trying to pay for gasoline...

Link to comment
Share on other sites

neither of the posted snippets work...

 

here is an example of what the latter displays:

 

blahblahblah

0

1

2

3

4

5

6

7

8

9

10

11

12

13

14

blahblahblah

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

blahblahblah

 

can anyone help me with this...?

 

Link to comment
Share on other sites

I am not a php coder but I am a decent php hack...what other code would you need?

 

How about the AdSense code?  How about the rest of the code that you use to make up your loop so we can see how you're getting the data?

Link to comment
Share on other sites

What I would like to do is is have a "Google AdSense" text ad be displayed after X amount of displayed rows...can I use php to include() the Adsense code in this manner?...If this is possible, can someone post an example of how the display counts the rows and includes the ad file.

 

if you want to help me I supplied a line of my display code in the OP...if you do not wish to actually help me just say so...

 

I gave you an example loop that displays something after X amount of displayed rows, just like you asked for.  No offense, but if you can't make sense of a simple condition inside a simple loop, then maybe you aren't the decent php hack you say you are.  There really isn't anything more we can do for you, short of doing your work for you, which is something we don't do.  People do that sort of thing for money. 

Link to comment
Share on other sites

you don't really need the adSense code...plain text will work as an example...

 

as for the loop..the script just displays a list of results through a pagination function...

 

how can I make it display "plain text" every 15 rows or so?

Link to comment
Share on other sites

you don't really need the adSense code...plain text will work as an example...

 

as for the loop..the script just displays a list of results through a pagination function...

 

how can I make it display "plain text" every 15 rows or so?

 

You make a loop with a condition in it.  Or you put a condition in your existing loop.  You know, like the example I already showed you.

Link to comment
Share on other sites

you holier than thou types are all alike

you're the bratty sounding ones...all I asked for was something that would actually help me...not give you a chance to play the school marm...

 

thanks for nothing as obviously your examples don't work when applied...

 

FYI...not everyone has the time or the budget to learn themselves or to hire a coder to just make a change to an existing script...

Link to comment
Share on other sites

Okay seriously man, you're starting to get out of line.  You have been given 2 examples of how to condition a loop to display something every X lines, just like you asked for.  They spit out numbers because they are example scripts, meant to display the principle for what you are asking for.  You have to take that principle and apply it to your own script. 

 

You asked for how to do something, and you were given examples that do exactly what you asked for.  It seems pretty obvious to me that you simply don't grasp the concept of applying the principle of one piece of code to another, and that's fine. I'm not judging.  But you need to make a much more concerted effort on your part if you wish to get anywhere with your code.  Yelling and screaming at us saying that we aren't being helpful just because you can't take the example, copy and paste it into your script and it magically works, is not making a concerted effort. 

 

I am closing your thread, as your question has been answered.  I'm sorry that you don't understand it, but it has been answered, nonetheless.  Instead of being grateful to those who have helped on their own free time, you've been rude and snippy and lazy. 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.