php directory

Discussion in 'PHP' started by nugget106, Dec 1, 2008.

  1. #1
    i am running php ld, i bought version 3 and it is very good.

    however, there is one bit i would like to change and that is the 'submit link' hyperlink. Whenever a user clicks on this link I would like them to view an advert before getting to the acutal page. I would like this only on this page.

    Do you know of any scripts or techniques to get this to work?
     
    nugget106, Dec 1, 2008 IP
  2. ariefsyu

    ariefsyu Active Member

    Messages:
    192
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    53
    #2
    maybe this idea could help

    on the link... you may use this url
    adv.php?link=actual_link
    Code (markup):
    and then in the adv.php, you can use some meta tags :
    <meta http-equiv="refresh" content="5;url=<?=$_GET['link']?>" />
    Code (markup):
    5 in the content attributes determining how long the adv.php showed in seconds before the page redirected to the actual links.

    Arief
     
    ariefsyu, Dec 1, 2008 IP
  3. nugget106

    nugget106 Active Member

    Messages:
    86
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    93
    #3
    thanks ariefsyu, i understand what you are doing, but i can't find the source code where it should go.
     
    nugget106, Dec 2, 2008 IP
  4. thundercow

    thundercow Well-Known Member

    Messages:
    246
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    108
    #4
    I see what he is doing. The specific source code will differ based on the skin/theme you are using. In my PHPLD installation, I go to my specific template in /templates/professional/ and in the file top_bar.tpl, within the code there is a line:

    <a href="{$smarty.const.DOC_ROOT}/submit.php{if !empty ($category.ID) and $category.ID > 0}?c={$category.ID}{/if}" title="{l}Submit your link to the directory{/l}">{l}Submit Link{/l}</a>

    I have bolded what is really the important part of the link, the part that links to the file "submit.php". Submit.php is the submission page, and that's the one you want to have your ad interjected before.

    With that in mind:

    1. Create the adv.php file to say whatever ad you want, put the code from the earlier poster in the meta section of that file (<meta http-equiv="refresh" content="5;url=<?=$_GET['link']?>" />), and put the adv.php file in the main directory where PHPLD is installed.

    2. replace "submit.php" in the code above (trick: search for "submit.php" within the PHPLD directory using Notepad++) with this code (from the earlier poster) adv.php?link=http://www.yoursite.com/submit.php
     
    thundercow, Dec 2, 2008 IP
  5. nugget106

    nugget106 Active Member

    Messages:
    86
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    93
    #5
    @ thundercow - thanks for the detailed help, greatly appreciated
     
    nugget106, Dec 20, 2008 IP