/ December 20, 2005

This is mod is about adding multiple featured link option on submit page.
difficulty level : moderate 

Note : as multiple files and databsae needs to changed in mod, taking backup before implementing this mod is highly recommended.

files need to changed: include/constants.php, include/tables.php, submit.php, payment.php, templates/submit.tpl, templates/payment.tpl and database table PLD_CONFIG

Mod begin

line numbers given are approximate, may change in your installation.
open include/constants.php

find (line 5)

Quote:
$link_type_int = array( ‘none’ => 0, ‘free’ => 1, ‘normal’ => 2, ‘reciprocal’ => 3, ‘featured’ => 4);

replace with 

Quote:
$link_type_int = array( ‘none’ => 0, ‘free’ => 1, ‘normal’ => 2, ‘reciprocal’ => 3, ‘featured’ => 4, ‘featuredyear’ => 5);

find (line 6)

Quote:
$link_type_str = array( 0 => _L(‘None’), 1 => _L(‘Free’), 2 => _L(‘Normal’), 3 => _L(‘Reciprocal’), 4 => _L(‘Featured’));

replace with

Quote:
$link_type_str = array( 0 => _L(‘None’), 1 => _L(‘Free’), 2 => _L(‘Normal’), 3 => _L(‘Reciprocal’), 4 => _L(‘Featured’), 5 => _L(‘Fetured_Year’));

—————————————————————————-
open include/tables.php
find (line 61)

Quote:
‘FEATURED’ => ‘I NOTNULL DEFAULT 0’,

add below

Quote:
‘FEATURED_YEAR’ => ‘I NOTNULL DEFAULT 0’,

find (line 75)

Quote:
‘FEATURED’ => ‘FEATURED’,

add below

Quote:
‘FEATURED_YEAR’ => ‘I NOTNULL DEFAULT 0’,

find (line 168)

Quote:
array(‘ID’ => ‘PAY_FEATURED’, ‘VALUE’ => ‘0’),

add below

Quote:
array(‘ID’ => ‘PAY_FEATURED_YEAR’, ‘VALUE’ => ‘0’),

—————————————————————————-
open submit.php

find (line 39)

Quote:
if (PAY_ENABLE == ‘1’ && PAYPAL_ACCOUNT != ”) {
$price = array ();
if (FTR_ENABLE == ‘1’ && PAY_FEATURED > 0) {
$price[‘featured’] = PAY_FEATURED;
}

add below

Quote:
if (FTR_ENABLE == ‘1’ && PAY_FEATURED_YEAR > 0) {
$price[‘featuredyear’] = PAY_FEATURED_YEAR;
}

find (line 153)

Quote:
case ‘featured’:
$data[‘FEATURED’] = 1;
break;

add below

Quote:
case ‘featuredyear’:
$data[‘FEATURED’] = 1;
break;

—————————————————————————-
open payment.php

find (line 57)

Quote:
if (FTR_ENABLE == ‘1’ && PAY_FEATURED > 0) {
$price[$link_type_int[‘featured’]] = PAY_FEATURED;
}

add below

Quote:
if (FTR_ENABLE == ‘1’ && PAY_FEATURED_YEAR > 0) {
$price[$link_type_int[‘featuredyear’]] = PAY_FEATURED_YEAR;
}

—————————————————————————-
open templates/submit.tpl

find

Quote:
{if $price.featured}
<tr><td><input type=”radio” name=”LINK_TYPE” value=”featured” {if $LINK_TYPE eq ‘featured’}checked=”true”{/if}>{l}Featured links{/l}</td><td>${$price.featured}</td></tr>
{/if}

add below

Quote:
{if $price.featuredyear}
<tr><td><input type=”radio” name=”LINK_TYPE” value=”featuredyear” {if $LINK_TYPE eq ‘featuredyear’}checked=”true”{/if}>{l}Featured link for 1 Year {/l}</td><td>${$price.featuredyear}</td></tr>
{/if}

—————————————————————————-
open template/payment.tpl
find (line 52)

Quote:
<td class=”field”>${$price.$LINK_TYPE}/{$payment_um.$um}</td>

replace with

Quote:
<td class=”field”>${$price.$LINK_TYPE}</td>

—————————————————————————-
now the last step.
open your database in phpmyadmin or any mysql DBmanger

run following sql command to add a row in “PLD_CONFIG” table
change value ’30’ to your desired price for featured link.

Quote:
INSERT INTO `PLD_CONFIG` ( `ID` , `VALUE` ) 
VALUES (
‘PAY_FEATURED_YEAR’, ’30’
);

—————————————————————————-
MOD end

this mod will display 2 featured listing option 1 set though admin panel and other for 1 year.
you can also add multiple options in this way

I haven’t done any modification in admin to manage this values. if you want to change values you need to change it in database.

Igonza Added: 

Quote:
—————————————————————————- 
open payment.php 

find (line 57)Quote: 
if (FTR_ENABLE == ‘1’ && PAY_FEATURED > 0) { 
$price[$link_type_int[‘featured’]] = PAY_FEATURED; 

add below Quote: 
if (FTR_ENABLE == ‘1’ && PAY_FEATURED_YEAR > 0) { 
$price[$link_type_int[‘featuredyear’]] = PAY_FEATURED_YEAR; 

—————————————————————————- 

I think it should look like :

Code:
if (FTR_ENABLE == ‘1’ && PAY_FEATURED > 0) { $price[$link_type_int[‘featured’]] = PAY_FEATURED; }

and 

Code:
if (FTR_ENABLE == ‘1’ && PAY_FEATURED_YEAR > 0) { $price[$link_type_int[‘featuredyear’]] = PAY_FEATURED_YEAR; }