...

View Full Version : How Do I Add This Bit Of Code?????



Byronwells
02-15-2010, 04:10 AM
Alright Guys

I have created a new db field called download_link and have linked it to the add products page. That is working fine. The information that is stored in that field is the filename and extention ie. text.zip

I have then attempted to get the information display on this page.. http://www.digitalresellersvault.com/member/marketplace.php?cat=t&category=demo_1 look under the demo 3 product

What I am trying to do is to get it to display in a url format. So all I need to do is add the file name on the add products page, then on the marketplace it will add it to a url link, and then display it..

The url link is suppose to look like this

<a href="http://www.digitalresellersvault.com/go/downloads/ "file name goes here"


I have tried all sort of cobinmations but all I can get to display is the filename, not a url link..

This is the code that I am using now

$download_link='<a href="http://www.digitalresellersvault.com/go/downloads/'$r[download_link]."></a>';

MattF
02-15-2010, 05:03 AM
Something along the lines of:



$download_link = '<a href="http://www.digitalresellersvault.com/go/downloads/'.$r[download_link].'">'.$filename.'</a>';

Byronwells
02-15-2010, 05:28 AM
Something along the lines of:



$download_link = '<a href="http://www.digitalresellersvault.com/go/downloads/'.$r[download_link].'">'.$filename.'</a>';


Where did you get the $filename from please??

I have not created that part :)

MattF
02-15-2010, 06:56 AM
Where did you get the $filename from please??

I have not created that part :)

Replace $filename with whatever you want to show as the link text. That was merely an example.

Len Whistler
02-15-2010, 07:02 AM
Also check the browser source code , View/Page Source with FireFox.


What is missing?
How can you correct the code to make the link work?




---------------

Byronwells
02-15-2010, 07:26 AM
Also check the browser source code , View/Page Source with FireFox.


What is missing?
How can you correct the code to make the link work?




---------------

Len

I already know what is missing.. That is why I am here asking you how to get that part to display/work correctly....

Byronwells
02-15-2010, 07:27 AM
Replace $filename with whatever you want to show as the link text. That was merely an example.

I thought so.. But when I did that nothing was displayed...

Byronwells
02-15-2010, 07:33 AM
Something along the lines of:



$download_link = '<a href="http://www.digitalresellersvault.com/go/downloads/'.$r[download_link].'">'.$filename.'</a>';


Here is the full marketplace.php code



<?php
include_once "include.php";
$hash=$_COOKIE["memcookie"];
$memberid=$common->check_session($hash,$db);
if($memberid != "")
{
include_once("session.php");
}

$GetFile = file("http://www.digitalresellersvault.com/template/header.php");
$Content = join("",$GetFile);
ob_start();

$q = "select sitename, description, keywords, bgimage, bgcolor, header, meta, footer from ".$prefix."site_settings where id='1'";
$r = $db->get_a_line($q);
@extract($r);
$meta = stripslashes($meta);
if($header != "")
{
$headers='<img src="../'.$header.'" border="0">';
}
if($bgimage != "")
{
$bgimage1='background ="../'.$bgimage.'"';
}
if($footer != "")
{
$footers='<img src="../'.$footer.'" border="0">';
}

// Get Menus
$q = "select * from ".$prefix."site_menus where id=1";
$r = $db->get_a_line($q);
@extract($r);
$member_menu=stripslashes($r["member_menu"]);
$jv_menu=stripslashes($r["jv_menu"]);

// Get the member user id
$q = "select * from ".$prefix."members where id='$memberid'" ;
$r = $db->get_a_line($q);
@extract($r);
$jv_status = $r[jv_status];
if ($jv_status !=1)
{
$jv_menu="";
}
if ($jv_status ==1)
{
$jvlink ="<a href=../jv/index.php>JV Partner Area</a>";
}

// Get top and bottom ads
$q = "select * from ".$prefix."ad_blocks where id='1'" ;
$r = $db->get_a_line($q);
@extract($r);
$top_ad = $r[top_ad];
$bottom_ad = $r[bottom_ad];

// Display text ads
$admin_ads_top=$common->adminadstop($db);
$content=str_replace("{admin_ads_top}",$admin_ads_top,$content);
$admin_ads_bottom=$common->adminadstop($db);
$content=str_replace("{admin_ads_bottom}",$admin_ads_bottom,$content);
$jv_ads_top=$common->jvads($db);
$content=str_replace("{jv_ads_top}",$jv_ads_top,$content);
$jv_ads_bottom=$common->jvads($db);
$content=str_replace("{jv_ads_bottom}",$jv_ads_bottom,$content);

// Parse content
$member_menu = preg_replace("/\[\[(.*?)\]\]/e","$$1",$member_menu);
$top_ad = preg_replace ("/\[\[(.*?)\]\]/e", "$$1", $top_ad);
$bottom_ad = preg_replace ("/\[\[(.*?)\]\]/e", "$$1", $bottom_ad);
$Content = preg_replace("/{{(.*?)}}/e","$$1",$Content);
$Content = preg_replace("/<{(.*?)}>/e","$$1",$Content);
echo $Content;
?>


The layout of the marketplace is this page...




<link href="http://www.digitalresellersvault.com/template/style.css" rel="stylesheet" type="text/css">
<div id="mainbody"> <!--Begin Wrap-->

<?php include("l_sidebar.php"); ?>
<?php include("r_sidebar.php"); ?>



<div id="middle"><div align="center">
<p>How To Download Products From Digital Resellers Vault:</p>
<p>&nbsp;</p>
</div>


<div class="productboxheader">
<div class="productboxtitle">
PRODUCT DOWNLOADS
</div>


</div>
<div class="producttop1">
<{Begin}>

</div>
<div class="producttop">


<div class="datebox">

<div align="center">Added:<br />
{{formatteddate}}</div>
</div>
<div class="producttitle">{{product_name}}</div>
<div class="productlicense">({{product_licence}} Included)</div>
<div class="productdashline">
</div>
<div class="productimage">

<div align="center">{{prod_image}}</div>
</div>
<div class="productdescription">
<table width="324" height="151">
<tr>
<td><div align="justify">The most important thing in every art form is to grasp the basics. One, who tries to learn an art form without knowing the basics and the origin of it, gets no success as their foundation is weak. Oil painting is an interesting form of art, but it must be understood to appreciate it and understand it well.</div></td>
</tr>
</table>
</div>


<div class="productdashline">

</div>
</div>
<div class="productbuttonsgroup">
<div class="Downloadbox">
{{filename}}</div>

<div class="moreinfobox">
{{salespage_link}}
</div>
<div class="viewsalespagebox">

<img src="http://www.digitalresellersvault.com/template/images/viewsalespagebutton.jpg" width="113" height="15" /> </div>

</div>



<div class="producttop1">

<{End}>
</div>

<div class="producttop1">
Page __single__ __first__ __previous__ &nbsp;
<{page_loopstart}>
<{page1}> &nbsp;
<{page_loopend}>
__next__ __last__
</div>

<div class="productbottom">
</div>


</div>




<div style="clear: both;">
<!-- PUT IT HERE -->
</div> <!-- end wrap--></div>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum