/    Sign up×
Community /Pin to ProfileBookmark

PHP to Javascript

I have Absolutely ZERO knowledge of php. I have a block of functions that i need to convert to JavaScript. Does anyone know how to handle this? or point me in the right direction? The Code is Below:

<?

// SET DATE AND TIME
$DateTime = gmdate(“F j, Y, g:i A”, time() -7200);

// PRINT BIG RATE ROWS
function BigRateRows($data_file){
require $data_file;
foreach($data as $k => $v) {
print “<!– ||||| BEGIN “.strtoupper($data[$k][‘bank_name’]).” ||||| –>n”;
print “<div class=”bank_listing”>n”;
print “<div class=”bank_listing_left”>n”;
if(isset($data[$k][‘bank_name’])){print “<span class=”bank_name”><a href=”http://{$data[$k][‘main_url’]}” >{$data[$k][‘bank_name’]}</a></span>n”;}
if(isset($data[$k][‘main_url’])){print “<span class=”main_url”>(<a href=”http://{$data[$k][‘main_url’]}” >{$data[$k][‘main_url’]}</a>)</span>n”;}
if(isset($data[$k][‘featured_product_name’])){print “<div class=”featured_product_name”>{$data[$k][‘featured_product_name’]}</div>n”;}
if(isset($data[$k][‘featured_product_notes’])){print “<div class=”featured_product_notes”>{$data[$k][‘featured_product_notes’]}</div>n”;}
if(isset($data[$k][‘other_products’])){print “<div class=”other_products”><strong>All Products:</strong> {$data[$k][‘other_products’]}</div>n”;}
print “</div>n”;
print “<div class=”bank_listing_right”>n”;
if(isset($data[$k][‘featured_product_yield’])){print “<div class=”featured_product_yield”>{$data[$k][‘featured_product_yield’]}%</div>n”;}
print “</div>n”;
print “</div>n”;
print “<!– ||||| END “.strtoupper($data[$k][‘bank_name’]).” ||||| –>nn”;
}
}

// PRINT MOCHILA VERTICAL NAV LIST
function Print_Mochila_Nav($data_file){
require $data_file;
global $id;
foreach($mochila as $k => $v){
print “<li>”;
if($k != $id){print “<a href=”resources/index.html?article={$k}” target=”_top”>”;}
print “{$mochila[$k][‘link_text’]}”;
if($k != $id){print “</a>”;}
print “</li>n”;
}
}

// PRINT A SPECIFIC FREE MOCHILA ARTICLE WITH A 300×250 MOCHILA AD
function Print_Mochila_Article($id, $data_file){
require $data_file;
if($mochila[$id][‘content’] != “”){print $mochila[$id][‘content’];}
else{
print “<script type=”text/javascript” src=”http://admatch-syndication.mochila.com/viewer/channel/loader?template=regularArticle&buyerId=www_savings_accounts_com665093&articleId={$mochila[$id][‘id’]}”></script>n”;
}
}

// GENERATE RANDOM QUOTES FOR PAGE FOOTERS
function ffq($data_file){
require $data_file;
$a = rand(0,count($quotes)-1);
print $quotes[$a][thecontent];
print “<br> – “;
print $quotes[$a][author];
}

// PRINT A8MEDIA NETWORK AS LIST ITEMS
function Print_Network($data_file){
require $data_file;
foreach($a8_network as $k => $v){
print “<li><strong><a href=”http://{$a8_network[$k][‘url’]}” target=”_top”>{$a8_network[$k][‘name’]}</a></strong>&nbsp;-&nbsp;<a href=”http://{$a8_network[$k][‘url’]}” target=”_top”>{$a8_network[$k][‘description’]}</a></li>n”;}
}

// PRINT SPECIFIC BANK DETAIL FUNCTIONS – ADDED BY ED 071023
function BankName($this_bank){ global $data; if(isset($data[$this_bank][‘bank_name’])){print $data[$this_bank][‘bank_name’];}}
function BankSAURL($this_bank){ global $data; if(isset($data[$this_bank][‘main_url’])){print $data[$this_bank][‘main_url’];}}
function BankFeaturedProductName($this_bank){ global $data; if(isset($data[$this_bank][‘featured_product_name’])){print $data[$this_bank][‘featured_product_name’];}}
function BankFeaturedProductYield($this_bank){ global $data; if(isset($data[$this_bank][‘featured_product_yield’])){print $data[$this_bank][‘featured_product_yield’];}}
function BankFeaturedProductNotes($this_bank){ global $data; if(isset($data[$this_bank][‘featured_product_notes’])){print $data[$this_bank][‘featured_product_notes’];}}
function BankOtherProducts($this_bank){ global $data; if(isset($data[$this_bank][‘other_products’])){print $data[$this_bank][‘other_products’];}}
function BankExitURL($this_bank){ global $data; if(isset($data[$this_bank][‘exit_url’])){print $data[$this_bank][‘exit_url’];}}

?>

to post a comment
JavaScript

0Be the first to comment 😎

×

Success!

Help @cap_0ne spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.3,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...