PHP - Template Titles
I followed this tutorial http://www.dynamicdrive.com/forums/showthread.php?t=28260. Everything is working fine but I cannot get the title on selected page to display. It will only display "Home" for the title on every page.
I need this to say the correct title of selected page Similar TutorialsHi,
I want to use an external rss in my site but the problem is that i only want to grab feeds that contain certain keywords in the title,
This is what i got so far to display the feed:
<?php $html = ""; $url = "http://www.feedsite.com/conv-rss.asp"; $xml = simplexml_load_file($url); for($i = 0; $i < 5; $i++){ $title = $xml->channel->item[$i]->title; $link = $xml->channel->item[$i]->link; $description = $xml->channel->item[$i]->description; $pubDate = $xml->channel->item[$i]->pubDate; $html .= "<a href='$link'><h3>$title</h3></a>"; $html .= "$description"; $html .= "<br />$pubDate<hr />"; } echo $html; ?>The feed is a classified jobs but i only need the jobs listed for musicians, keywords could be: bassist, singer, drummer, musician, etc.. Thanks I am using a header as an include, now I am wondering if there is a simple way, using php, of giving each page a seperate title, instead of them all having the standard title in the header? The code works but the title is repeated with each new set of data. I want the titles set up at the top and never repeating... No idea what is causing it.
$conn = new mysqli($servername, $username, $password, $dbname); $sql = "SELECT deadchar, level, class, killforumid, realm, date FROM pkdata ORDER BY deadchar DESC"; $result = $conn->query($sql); while($row = $result->fetch_assoc()) { $deadchar = $row['deadchar']; $level = $row['level']; $class = $row['class']; $killforumid = $row['killforumid']; $realm = $row['realm']; $date = $row['date']; $conn->close(); echo "<table><center><tr> <th> <font size=3 color=#070719>Victim</font> </th> <th> <font size=3 color=#070719>Level</font> </th> <th> <font size=3 color=#070719>Class</font> </th> <th> <font size=3 color=#070719>Killer</font> </th> <th> <font size=3 color=#070719>Realm</font> </th> <th> <font size=3 color=#070719>Date</font> </th> </tr></center>"; echo "<tr><center> <td><center>$deadchar</center></td> <td><center>$level</center></td> <td><center>$class</center></td> <td><center>$killforumid</center></td> <td><center>$realm</center></td> <td><center>$date</center></td> </tr>"; echo "</table>"; } ?> Hi There, I would like my webpage title to change for each sub-site that I visit say I go to player A I want the website name to say CNGHLDB-Player A and If I go to player B profile it would change to say CNGHLDB-Player B I have the names in my php script so I am assuming it shouldn't be to hard to do the coding for it, but I am not sure how to do it. <title>CNGHLDB</title> </head> <? // Connects to your Database mysql_connect("", "", "") or die(mysql_error()); mysql_select_db("") or die(mysql_error()); //Get PlayerID from URL $iPlayerID = $_GET["PlayerID"]; $iNationID = $_GET["NationID"]; $oPlayerInfo = mysql_query(" SELECT Players.PlayerID, Players.FirstName, Players.LastName, Players.Position, Players.Height, Players.Weight, Players.DOB, CNGHLTeams.CNGHLRights, NHLTeams.Team, Players.CNDraftYR, DraftTeam.DraftID, Players.CNDraftPOS, Countries.Nation, Players.NationID, DraftTeam.DrTeam FROM Players Left JOIN CNGHLTeams ON Players.CNGHLID=CNGHLTeams.CNGHLID Left JOIN NHLTeams ON Players.TeamsID=NHLTeams.TeamID Left JOIN Countries ON Players.NationID=Countries.NationID Left JOIN DraftTeam ON Players.DraftID=DraftTeam.DraftID WHERE Players.PlayerID=$iPlayerID ORDER BY Players.LastName; ") or die(mysql_error()); while($row = mysql_fetch_array($oPlayerInfo)) { Print "<body>"; ECHO "<div align='center'>"; ECHO "<table width='496' border='0'>"; ECHO "<tr>"; ECHO "<td width='148'><div align='center'><a href=\"http://www.cnghl.org/cnghldb/index.php\"><strong>SEARCH PLAYERS</strong></a></div></td>"; ECHO "<td width='152'><div align='center'><a href=\"http://www.cnghl.org/cnghldb/goaliesearch.php\"><strong>SEARCH GOALIES</strong></a></div></td>"; ECHO "<td width='182'><div align='center'><strong><a href=\"http://www.cnghl.biz/history/league.html\">FRANCHISE HISTORY</a></strong></div></td>"; ECHO "</tr> </table> </div> <p align='center'> </p> <p>"; Print "<center> </p> <div align='center'> <table width='700' border='0'> </center>"; Print "<tr>"; Print "<td colspan='3'><h1>".$row['FirstName']." ".$row['LastName']." <img src=\"http://www.cnghl.org/cnghldb/nation/".$row['NationID'].".gif\"></h1></td>"; Print "</tr>"; Print "<tr>"; Print "<td width='300' height='26'><strong>Birthdate: </strong>".$row['DOB']."</td>"; $DOB = $row[DOB]; //dd.mm.yyyy $user_date = new DateTime($DOB); $curr_date = new DateTime(); $age_cal = $curr_date->diff($user_date); Print "<td width='525'><strong>Age: </strong>".$age_cal->y;"</td>"; Print "<td style='vertical-align:top;'width='275' rowspan='10'><div align='center'><img src=\"http://www.cnghl.org/cnghldb/images/".$iPlayerID.".jpg\">"; Print "</tr>"; Print "<tr>"; Print "<td><strong>Nation: </strong>".$row['Nation']."</td>"; Print "<td><strong>CNGHL Team: </strong>".$row['CNGHLRights']. "</td>"; Print "</tr>"; Print "<tr>"; Print "<td><strong>Position: </strong>".$row['Position']. "</td>"; Print "<td><strong>Weight: </strong>".$row['Weight']. "</td>"; Print "</tr>"; Print "<tr>"; Print "<td><strong>Height: </strong>".$row['Height']. "</td>"; Print "<td><strong>NHL Team: </strong>".$row['Team']. "</td>"; Print "</tr>"; Print "<tr>"; Print "<td><strong>Draft Year: </strong>".$row['CNDraftYR']."</td>"; Print "<td><strong>Draft Position: </strong>".$row['CNDraftPOS']."</td>"; Print "</tr>"; Print "<tr>"; Print "<td><strong>Drafted By: </strong>".$row['DrTeam']."</td>"; Print "<td> </td>"; Print "</tr>"; Print " <tr> <td height='179' colspan='2'> </td> </tr> The coding that pulls there names that I would want to use is Firstname and Lastname or I have the simpler full name that include both first and last names. Thanks for your help! Edited by mac_gyver, 10 June 2014 - 03:36 AM. code tags around code please
I'm creating an edit page that has a many to many relationship between the banners table and the frames table. I hope I've explained everything clearly. So for example I have Quote
Frame 1 Instead of Quote
Frame 1 This is my tables banners table Quote
id | title frames table Quote
id | title | description | image banner_frame table Quote
id | banner_id | frame_id Here is my code $query = "SELECT frames.id as frameId, frames.title as frameTitle, banners.id as banner_id "; $query .= "FROM frames "; $query .= "LEFT JOIN banner_frame ON banner_frame.frame_id = frames.id "; $query .= "LEFT JOIN banners ON banners.id = banner_frame.banner_id"; $banner_frame = mysqli_query($conn, $query); confirmQuery($banner_frame); while($row = mysqli_fetch_assoc($banner_frame)) { $frame_id = $row['frameId']; $frame_title = $row['frameTitle']; $checked = ''; if ($row['banner_id'] == $banner_id) { $checked = 'checked'; } echo "<div class='form-check'>"; echo "<input type='checkbox' name='frames[]' id='frame_checkbox' value='$frame_id' $checked> "; echo "<label for='frame_checkbox'>"; echo $frame_title; echo "</label>"; echo "</div>"; } Edited September 25, 2019 by Chibi Hi peeps, was wondering if anyone could help, i have decided I want to put page titles in to my website at the moment i have a static title which is the business name and slogan, what I want is business name - slogan - page title (E.G home) my title is set in a header.php file which is then included in all pages. any ideas? Hi all Recently designed a site using includes, but only realised when I'd almost finished the project that because the (e.g.) include("includes/header.html"); had the <head> information (titles, meta description, etc) every single page included the same information (by the way hope this makes sense) A way I thought of getting around this was to store each pages title and meta description in a database or in for example or maybe in a variables.php file. But I'm not sure whether this is the best way. I'm not a PHP expert so simple explainations would be very much appriciated. Look forward to hearing from you all. Adi <ul> <!-- List the rest of the articles found in the category --> <?php else : ?> <li class="otherrecentmain"><span class="title"><a href="<?php the_permalink() ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></span> <span class="meta"></span> </li> <?php endif; ?> <?php endwhile; ?> <!-- END --> </ul> For some reason, its stuck on displaying 9 articles but I want to be able to control how many I want. I may want to choose 17 or whatever etc, not sure how to add it into the php. I feel like a moron asking this question as it seems to be one of the most common things done with php but I cannot find a tutorial (probably because I don't know the correct wording to search under) on this specific thing.. Anyhow. I'm spitting out a list of the Titles of my test table like so (and its working as expected): <?php $posting_sql = "SELECT * FROM postings"; $posting_results = (mysqli_query($cxn, $posting_sql)) or die("Was not able to grab the Postings!"); while($posting_row = mysqli_fetch_array($posting_results)) { echo "<li><a href='posting_details.php'>$posting_row[title]</a></li>"; } ?> Now as you can see: <a href='posting_details.php'> I am calling a new page, and that page contains this: <h2><?php echo "$posting_row[title]"; ?></h2> <p><?php echo "$posting_row[description]"; ?></p> It's no surprise it's not working (with many variations etc), but I am only familiar with using <form> GET or POST, and these of course are not form elements, so I cant seem to call them the same way. My suspicion (and from the research data I could find) is that I need to pass values in my link: <a href='posting_details.php'> ... I could not get it to work, but I was trying variations like: <a href='posting_details.php?get[title&get[description]]'> but it seems like I am screwing things up even more by doing this.. Anyhow. If anyone could show me a tutorial that covers this specifically or some suggestions on the best approach to this would be much appreciated.. hey guys im making a template class which is working and im trying to impliment a loop section for MySQL results... but i need to be able to find a match for a string such as: {section name=1 loop=$2} content {/section} but also extract the values of name, loop and the section content if anyone could advise me on the best way this can be done please...thank you Hello i am going to try out fpdf generator, but i wanted to know if anyone knows where i can get invoice templates or how would i go to create them. Could i create them with css and html? hello. how can i code this so that if the page is an admin page i get the admin template and if the page is a public page i get the public template i seem to be having trouble with my function and if statements this is the code Code: [Select] //$layout gets the header.php and the footer.php function include_layout($layout){ //this part find all pages Zone. zone is either Admin or Public $pageZone = Pages::find_all(); foreach ($pageZone as $pageZones){ $Pzone = $pageZones->zone; } //this part gets the template id that is set for admin and public $tempBS = BasicSettings::find_by_id(1); $atID = $tempBS->adminTemp_id; $ptID = $tempBS->publicTemp_id; // if page is admin get the admin template if ($pZone = "admin"){ $Atemp = Templates::find_adminTemp($atID); $ATname = $Atemp->name; include(TEMP.DS.$ATname.DS.'layouts'.DS.$layout); } // if page is public get the public template if($pZone = "public"){ $Ptemp = Templates::find_publicTemp($ptID); $PTname = $Ptemp->name; include(TEMP.DS.$PTname.DS.'layouts'.DS.$layout); } } to help you understand what im doing i have put a // description above each part of code. the problem is that i get the header echoed out twice. if i change the if to an if else like this... Code: [Select] if ($pZone = "admin"){ $Atemp = Templates::find_adminTemp($atID); $ATname = $Atemp->name; include(TEMP.DS.$ATname.DS.'layouts'.DS.$layout); }else if($pZone = "public"){ $Ptemp = Templates::find_publicTemp($ptID); echo $PTname = $Ptemp->name; include(TEMP.DS.$PTname.DS.'layouts'.DS.$layout); } i only get 1 header but the public template does not work template this is because if i echo out Code: [Select] echo $PTname = $Ptemp->name; i get nothing so. how can i code it so that if the page is an admin page i get the admin template and if the page is a public page i get the public template thanks ricky Hey guys, I'm starting to build a website and I was wondering wether I should use a library template engine such as smarty, or use pure php, such as this tutorial - http://www.massassi.com/php/articles/template_engines/ Basically the website will not expose any of the users/designers to the designer portion of the website. I am scratching my head wether I should use smarty or pure php, even Facebook uses smarty, from what I have heard. I need some answers. Thank you all! I've created a template system. I've got a function to assign a page (the templates are in /template/skin). It all works fine in the main root, but if I had a directory it won't work. $dir = "template/skin"; That is found in template/ I need to be able to assign the template even in directories. Ok... So I have a while() query to pull support tickets from my database. I would like to setup a system where the while() function is called inside a template file, without having the template file contain the lines of code for it. Example While Function: $open_tickets = mysql_query("SELECT * FROM support_tickets WHERE user_id='$id' && order_by='1' && ticket_status='open' ORDER BY ticket_id DESC") or die(mysql_error()); while($tick = mysql_fetch_array($open_tickets, MYSQL_ASSOC)) { ?> <tr><td><a href="tickets.php?id=<?php echo $tick['ticket_id'].'">'.$tick['ticket_title']; ?></a></td><td><div align="center"><?php echo $tick['ticket_reply']; ?></div></td><td><div align="center"><?php echo $tick['ticket_urgency']; ?></div></td></tr> <?php } It would be awesome if I could get all that to run off of looping variables so that the template looks like: <?php $begin_while; ?> <tr><td><a href="tickets.php?id=<?php echo $ticket_id; ?>"><?php echo $ticket_title; ?></a></td><td><div align="center"><?php echo $ticket_reply; ?></div></td><td><div align="center"><?php echo $ticket_urgency; ?></div></td></tr> <?php $end_while; ?> or something similar. Suggestions? I don't want to implement smarty or another template system, at least not yet... I just want something in php that can do what's described above. Of course all I'm really looking for is something that looks cleaner... Could I make the while function $tick into something smaller and place the query into the system instead of the template? I'm trying to develop a website file manager. I want to allow SSI, and would like to handle it specifically.. Code: [Select] $regexp = "<!--#include\s[^>]*virtual=(\"??)([^\" >]*?)\\1[^>]*\/-->"; if(preg_match_all("/$regexp/siU", $body, $matches, PREG_SET_ORDER)) { foreach($matches as $match) { $includeFile = $match[2]; } } This snippet shows how you would get the included file path in the SSI code of the website body [ the $body tag ], but I don't need to just find it- I want to replace the SSI code with a simpler code in the HTML that appears in the editor for easy management.. Then switch back from my easier code to the actual SSI code.. Example: Replace Code: [Select] <!--#include virtual="/newsManager/output.php"--> With Code: [Select] {INCLUDE=/newsManager/output.php} THEN when the user saves the page, Replace Code: [Select] {INCLUDE=/newsManager/output.php} With Code: [Select] <!--#include virtual="/newsManager/output.php"--> Is there an easy fix or should I just switch to a full blown template engine.. even though this is the only required feature? Hello everyone, Can someone help to add "add to Google Calendar" link referensing booking time, date and location under "Comment" line in this php? <?php $Date=new CHBSDate(); $Length=new CHBSLength(); $Validation=new CHBSValidation(); $BookingFormElement=new CHBSBookingFormElement(); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <?php if(is_rtl()) { ?> <style type="text/css"> body { direction:rtl; } </style> <?php } ?> </head> <body> <table cellspacing="0" cellpadding="0" width="100%" bgcolor="#EEEEEE"<?php echo $this->data['style']['base']; ?>> <tr height="50px"><td></td></tr> <tr> <td> <table cellspacing="0" cellpadding="0" width="600px" border="0" align="center" bgcolor="#FFFFFF" style="border:solid 1px #E1E8ED;padding:50px"> <!-- --> <?php $logo=CHBSOption::getOption('logo'); if($Validation->isNotEmpty('logo')) { ?> <tr> <td> <img style="max-width:100%;height:auto;" src="<?php echo esc_attr($logo); ?>" alt=""/> <br/><br/> </td> </tr> <?php } ?> <!-- --> <tr> <td <?php echo $this->data['style']['header']; ?>><?php esc_html_e('General','chauffeur-booking-system'); ?></td> </tr> <tr><td <?php echo $this->data['style']['separator'][3]; ?>><td></tr> <tr> <td> <table cellspacing="0" cellpadding="0"> <tr> <td <?php echo $this->data['style']['cell'][1]; ?>><?php esc_html_e('Title','chauffeur-booking-system'); ?></td> <td <?php echo $this->data['style']['cell'][2]; ?>><?php echo $this->data['booking']['booking_title']; ?></td> </tr> <tr> <td <?php echo $this->data['style']['cell'][1]; ?>><?php esc_html_e('Status','chauffeur-booking-system'); ?></td> <td <?php echo $this->data['style']['cell'][2]; ?>><?php echo esc_html($this->data['booking']['booking_status_name']); ?></td> </tr> <tr> <td <?php echo $this->data['style']['cell'][1]; ?>><?php esc_html_e('Service type','chauffeur-booking-system'); ?></td> <td <?php echo $this->data['style']['cell'][2]; ?>><?php echo esc_html($this->data['booking']['service_type_name']); ?></td> </tr> <tr> <td <?php echo $this->data['style']['cell'][1]; ?>><?php esc_html_e('Transfer type','chauffeur-booking-system'); ?></td> <td <?php echo $this->data['style']['cell'][2]; ?>><?php echo esc_html($this->data['booking']['transfer_type_name']); ?></td> </tr> <tr> <td <?php echo $this->data['style']['cell'][1]; ?>><?php esc_html_e('Pickup date and time','chauffeur-booking-system'); ?></td> <td <?php echo $this->data['style']['cell'][2]; ?>><?php echo esc_html($Date->formatDateToDisplay($this->data['booking']['meta']['pickup_date']).' '.$Date->formatTimeToDisplay($this->data['booking']['meta']['pickup_time'])); ?></td> </tr> <?php if(in_array($this->data['booking']['meta']['service_type_id'],array(1,3))) { if((int)$this->data['booking']['meta']['transfer_type_id']===3) { ?> <tr> <td <?php echo $this->data['style']['cell'][1]; ?>><?php esc_html_e('Return date and time','chauffeur-booking-system'); ?></td> <td <?php echo $this->data['style']['cell'][2]; ?>><?php echo esc_html($Date->formatDateToDisplay($this->data['booking']['meta']['return_date']).' '.$Date->formatTimeToDisplay($this->data['booking']['meta']['return_time'])); ?></td> </tr> <?php } } if((int)$this->data['booking']['meta']['price_hide']===0) { ?> <tr> <td <?php echo $this->data['style']['cell'][1]; ?>><?php esc_html_e('Order total amount','chauffeur-booking-system'); ?></td> <td <?php echo $this->data['style']['cell'][2]; ?>><?php echo esc_html(CHBSPrice::format($this->data['booking']['billing']['summary']['value_gross'],$this->data['booking']['meta']['currency_id'])); ?></td> </tr> <?php if($this->data['booking']['meta']['payment_deposit_enable']==1) { ?> <tr> <td <?php echo $this->data['style']['cell'][1]; ?>><?php echo sprintf(esc_html('To pay (deposit %s%%)','chauffeur-booking-system'),$this->data['booking']['meta']['payment_deposit_value']); ?></td> <td <?php echo $this->data['style']['cell'][2]; ?>><?php echo esc_html(CHBSPrice::format($this->data['booking']['billing']['summary']['pay'],$this->data['booking']['meta']['currency_id'])); ?></td> </tr> <?php } if(in_array($this->data['booking']['meta']['service_type_id'],array(1,3))) { ?> <tr> <td <?php echo $this->data['style']['cell'][1]; ?>><?php esc_html_e('Distance','chauffeur-booking-system'); ?></td> <td <?php echo $this->data['style']['cell'][2]; ?>> <?php echo $Length->format($this->data['booking']['billing']['summary']['distance'],$this->data['booking']['meta']['length_unit']); ?> </td> </tr> <?php } } ?> <tr> <td <?php echo $this->data['style']['cell'][1]; ?>><?php esc_html_e('Duration','chauffeur-booking-system'); ?></td> <td <?php echo $this->data['style']['cell'][2]; ?>> <?php echo esc_html($this->data['booking']['billing']['summary']['duration']); ?> </td> </tr> <?php if($this->data['booking']['meta']['passenger_enable']==1) { ?> <tr> <td <?php echo $this->data['style']['cell'][1]; ?>><?php esc_html_e('Passengers','chauffeur-booking-system'); ?></td> <td <?php echo $this->data['style']['cell'][2]; ?>><?php echo esc_html(CHBSBookingHelper::getPassengerLabel($this->data['booking']['meta']['passenger_adult_number'],$this->data['booking']['meta']['passenger_children_number'])); ?></td> </tr> <?php } if($Validation->isNotEmpty($this->data['booking']['meta']['comment'])) { ?> <tr> <td <?php echo $this->data['style']['cell'][1]; ?>><?php esc_html_e('Comment','chauffeur-booking-system'); ?></td> <td <?php echo $this->data['style']['cell'][2]; ?>><?php echo esc_html($this->data['booking']['meta']['comment']); ?></td> </tr> <?php } ?> </table> </td> </tr> <!-- --> <tr><td <?php echo $this->data['style']['separator'][2]; ?>><td></tr> <tr> <td <?php echo $this->data['style']['header']; ?>><?php esc_html_e('Route','chauffeur-booking-system'); ?></td> </tr> <tr><td <?php echo $this->data['style']['separator'][3]; ?>><td></tr> <tr> <td> <table cellspacing="0" cellpadding="0"> <?php if($this->data['booking']['meta']['service_type_id']==3) { ?> <tr> <td <?php echo $this->data['style']['cell'][1]; ?>><?php esc_html_e('Route name','chauffeur-booking-system'); ?></td> <td <?php echo $this->data['style']['cell'][2]; ?>><?php echo esc_html($this->data['booking']['meta']['route_name']); ?></td> </tr> <?php } if(in_array($this->data['booking']['meta']['service_type_id'],array(1,3))) { if($this->data['booking']['meta']['extra_time_enable']==1) { ?> <tr> <td <?php echo $this->data['style']['cell'][1]; ?>><?php esc_html_e('Extra time','chauffeur-booking-system'); ?></td> <td <?php echo $this->data['style']['cell'][2]; ?>><?php echo esc_html($Date->formatMinuteToTime($this->data['booking']['meta']['extra_time_value'])); ?></td> </tr> <?php } } ?> </table> </td> </tr> <!-- --> <tr><td <?php echo $this->data['style']['separator'][2]; ?>><td></tr> <tr> <td <?php echo $this->data['style']['header']; ?>><?php esc_html_e('Route locations','chauffeur-booking-system'); ?></td> </tr> <tr><td <?php echo $this->data['style']['separator'][3]; ?>><td></tr> <tr> <td> <table cellspacing="0" cellpadding="0"> <tr> <td> <ol <?php echo $this->data['style']['list'][1]; ?>> <?php foreach($this->data['booking']['meta']['coordinate'] as $index=>$value) { $address=esc_html($value['address']); if(array_key_exists('formatted_address',$value)) $address='<b>'.esc_html($value['formatted_address']).'</b> '.$address; ?> <li <?php echo $this->data['style']['list'][2]; ?>><a href="https://www.google.com/maps/?q=<?php echo esc_attr($value['lat']).','.esc_attr($value['lng']); ?>" target="_blank"><?php echo $address; ?></a></li> <?php } ?> </ol> </td> </tr> </table> </td> </tr> <!-- --> <tr><td <?php echo $this->data['style']['separator'][2]; ?>><td></tr> <tr> <td <?php echo $this->data['style']['header']; ?>><?php esc_html_e('Vehicle','chauffeur-booking-system'); ?></td> </tr> <tr><td <?php echo $this->data['style']['separator'][3]; ?>><td></tr> <tr> <td> <table cellspacing="0" cellpadding="0"> <tr> <td <?php echo $this->data['style']['cell'][1]; ?>><?php esc_html_e('Vehicle name','chauffeur-booking-system'); ?></td> <td <?php echo $this->data['style']['cell'][2]; ?>><?php echo esc_html($this->data['booking']['meta']['vehicle_name']); ?></td> </tr> </table> </td> </tr> <!-- --> <?php if(count($this->data['booking']['meta']['booking_extra'])) { ?> <tr><td <?php echo $this->data['style']['separator'][2]; ?>><td></tr> <tr> <td <?php echo $this->data['style']['header']; ?>><?php esc_html_e('Extra','chauffeur-booking-system'); ?></td> </tr> <tr><td <?php echo $this->data['style']['separator'][3]; ?>><td></tr> <tr> <td> <table cellspacing="0" cellpadding="0"> <tr> <td> <ol <?php echo $this->data['style']['list'][1]; ?>> <?php foreach($this->data['booking']['meta']['booking_extra'] as $index=>$value) { ?> <li <?php echo $this->data['style']['list'][2]; ?>> <?php echo esc_html($value['quantity']); ?> <?php esc_html_e('x','chauffeur-booking-system'); ?> <?php echo esc_html($value['name']); ?> <?php if((int)$this->data['booking']['meta']['price_hide']===0) { echo ' - '.CHBSPrice::format(CHBSPrice::calculateGross($value['price'],0,$value['tax_rate_value'])*$value['quantity'],$this->data['booking']['meta']['currency_id']); } ?> </li> <?php } ?> </ol> </td> </tr> </table> </td> </tr> <?php } ?> <!-- --> <tr><td <?php echo $this->data['style']['separator'][2]; ?>><td></tr> <tr> <td <?php echo $this->data['style']['header']; ?>><?php esc_html_e('Client details','chauffeur-booking-system'); ?></td> </tr> <tr><td <?php echo $this->data['style']['separator'][3]; ?>><td></tr> <tr> <td> <table cellspacing="0" cellpadding="0"> <tr> <td <?php echo $this->data['style']['cell'][1]; ?>><?php esc_html_e('First name','chauffeur-booking-system'); ?></td> <td <?php echo $this->data['style']['cell'][2]; ?>><?php echo esc_html($this->data['booking']['meta']['client_contact_detail_first_name']); ?></td> </tr> <tr> <td <?php echo $this->data['style']['cell'][1]; ?>><?php esc_html_e('Last name','chauffeur-booking-system'); ?></td> <td <?php echo $this->data['style']['cell'][2]; ?>><?php echo esc_html($this->data['booking']['meta']['client_contact_detail_last_name']); ?></td> </tr> <tr> <td <?php echo $this->data['style']['cell'][1]; ?>><?php esc_html_e('E-mail address','chauffeur-booking-system'); ?></td> <td <?php echo $this->data['style']['cell'][2]; ?>><?php echo esc_html($this->data['booking']['meta']['client_contact_detail_email_address']); ?></td> </tr> <tr> <td <?php echo $this->data['style']['cell'][1]; ?>><?php esc_html_e('Phone number','chauffeur-booking-system'); ?></td> <td <?php echo $this->data['style']['cell'][2]; ?>><?php echo esc_html($this->data['booking']['meta']['client_contact_detail_phone_number']); ?></td> </tr> <?php echo $BookingFormElement->displayField(1,$this->data['booking']['meta'],2,array('style'=>$this->data['style'])); ?> </table> </td> </tr> <!-- --> <?php if((int)$this->data['booking']['meta']['client_billing_detail_enable']===1) { ?> <tr><td <?php echo $this->data['style']['separator'][2]; ?>><td></tr> <tr> <td <?php echo $this->data['style']['header']; ?>><?php esc_html_e('Billing address','chauffeur-booking-system'); ?></td> </tr> <tr><td <?php echo $this->data['style']['separator'][3]; ?>><td></tr> <tr> <td> <table cellspacing="0" cellpadding="0"> <tr> <td <?php echo $this->data['style']['cell'][1]; ?>><?php esc_html_e('Company name','chauffeur-booking-system'); ?></td> <td <?php echo $this->data['style']['cell'][2]; ?>><?php echo esc_html($this->data['booking']['meta']['client_billing_detail_company_name']); ?></td> </tr> <tr> <td <?php echo $this->data['style']['cell'][1]; ?>><?php esc_html_e('Tax number','chauffeur-booking-system'); ?></td> <td <?php echo $this->data['style']['cell'][2]; ?>><?php echo esc_html($this->data['booking']['meta']['client_billing_detail_tax_number']); ?></td> </tr> <tr> <td <?php echo $this->data['style']['cell'][1]; ?>><?php esc_html_e('Street name','chauffeur-booking-system'); ?></td> <td <?php echo $this->data['style']['cell'][2]; ?>><?php echo esc_html($this->data['booking']['meta']['client_billing_detail_street_name']); ?></td> </tr> <tr> <td <?php echo $this->data['style']['cell'][1]; ?>><?php esc_html_e('Street number','chauffeur-booking-system'); ?></td> <td <?php echo $this->data['style']['cell'][2]; ?>><?php echo esc_html($this->data['booking']['meta']['client_billing_detail_street_number']); ?></td> </tr> <tr> <td <?php echo $this->data['style']['cell'][1]; ?>><?php esc_html_e('City','chauffeur-booking-system'); ?></td> <td <?php echo $this->data['style']['cell'][2]; ?>><?php echo esc_html($this->data['booking']['meta']['client_billing_detail_city']); ?></td> </tr> <tr> <td <?php echo $this->data['style']['cell'][1]; ?>><?php esc_html_e('State','chauffeur-booking-system'); ?></td> <td <?php echo $this->data['style']['cell'][2]; ?>><?php echo esc_html($this->data['booking']['meta']['client_billing_detail_state']); ?></td> </tr> <tr> <td <?php echo $this->data['style']['cell'][1]; ?>><?php esc_html_e('Postal code','chauffeur-booking-system'); ?></td> <td <?php echo $this->data['style']['cell'][2]; ?>><?php echo esc_html($this->data['booking']['meta']['client_billing_detail_postal_code']); ?></td> </tr> <tr> <td <?php echo $this->data['style']['cell'][1]; ?>><?php esc_html_e('Country','chauffeur-booking-system'); ?></td> <td <?php echo $this->data['style']['cell'][2]; ?>><?php echo esc_html($this->data['booking']['client_billing_detail_country_name']); ?></td> </tr> <?php echo $BookingFormElement->displayField(2,$this->data['booking']['meta'],2,array('style'=>$this->data['style'])); ?> </table> </td> </tr> <?php } $panel=$BookingFormElement->getPanel($this->data['booking']['meta']); foreach($panel as $panelIndex=>$panelValue) { if(in_array($panelValue['id'],array(1,2))) continue; ?> <tr><td <?php echo $this->data['style']['separator'][2]; ?>><td></tr> <tr> <td <?php echo $this->data['style']['header']; ?>><?php echo esc_html($panelValue['label']); ?></td> </tr> <tr><td <?php echo $this->data['style']['separator'][3]; ?>><td></tr> <tr> <td> <table cellspacing="0" cellpadding="0"> <?php echo $BookingFormElement->displayField($panelValue['id'],$this->data['booking']['meta'],2,array('style'=>$this->data['style'])); ?> </table> </td> </tr> <?php } ?> <!-- --> <?php if(!empty($this->data['booking']['meta']['payment_id'])) { ?> <tr><td <?php echo $this->data['style']['separator'][2]; ?>><td></tr> <tr> <td <?php echo $this->data['style']['header']; ?>><?php esc_html_e('Payment','chauffeur-booking-system'); ?></td> </tr> <tr><td <?php echo $this->data['style']['separator'][3]; ?>><td></tr> <tr> <td> <table cellspacing="0" cellpadding="0"> <tr> <td <?php echo $this->data['style']['cell'][1]; ?>><?php esc_html_e('Payment','chauffeur-booking-system'); ?></td> <td <?php echo $this->data['style']['cell'][2]; ?>> <?php echo esc_html($this->data['booking']['payment_name']); if($Validation->isNotEmpty($this->data['booking']['woocommerce_payment_url'])) echo '<br><a href="'.esc_url($this->data['booking']['woocommerce_payment_url']).'" target="_blank">'.__('Click to pay for this order','chauffeur-booking-system').'</a>'; ?> </td> </tr> </table> </td> </tr> <?php } ?> </table> </td> </tr> <tr height="50px"><td></td></tr> </table> </body> </html> Many thanks Edited June 30, 2019 by KOTHey guys, I hate being a beggar but I am trying to figure out how to remove links from aawp-box__image and aawp-box__title. That’s a script from a plugin that uses Amazon to get the name, images, and other stuff of products directly on my site. I was wondering if there is a way to delete the links while still have the images downloaded from Amazon (the plugin is AAWP). Maybe someone can help me here?
<?php /* * Box template * ------------ * It's possible to display multiple boxes at once * * @package AAWP */ if ( ! defined( 'ABSPATH' ) ) { die( '-1' ); } ?> <?php foreach ( $this->items as $i => $item ) : ?> <?php $this->setup_item($i, $item); ?> <div class="<?php echo $this->get_classes('box'); ?>" <?php $this->the_product_container(); ?>> <div class="aawp-box__thumb"> <a class="aawp-box__image-link" ?>" title="<?php echo $this->get_product_image_link_title(); ?>" rel="nofollow" target="_blank"> <img class="aawp-box__image" src="<?php echo $this->get_product_image(); ?>" alt="<?php echo $this->get_product_image_alt(); ?>" <?php $this->the_product_image_title(); ?> /> </a> <?php if ( $this->get_product_rating() ) { ?> <div class="aawp-box__rating"> <?php echo $this->get_product_star_rating(); ?> <?php if ( $this->get_product_reviews() ) { ?> <div class="aawp-box__reviews"><?php echo $this->get_product_reviews(); ?></div> <?php } ?> </div> <?php } ?> </div> <div class="aawp-box__content"> <a class="aawp-box__title" ?>" title="<?php echo $this->get_product_link_title(); ?>" rel="nofollow" target="_blank"> <?php echo $this->get_product_title(); ?> </a> <div class="aawp-box__description"> <?php echo $this->get_product_description(); ?> </div> </div> <div class="aawp-box__footer"> <?php if ( $this->get_product_is_sale() ) { ?> <span class="aawp-box__ribbon aawp-box__sale"> <?php if ( $this->show_sale_discount() && $this->is_sale_discount_position('ribbon') ) { ?> <?php echo $this->get_saved_text(); ?> <?php } else { ?> <?php echo $this->get_sale_text(); ?> <?php } ?> </span> <?php } ?> <div class="aawp-box__pricing"> <?php if ( $this->get_product_is_sale() && $this->show_sale_discount() ) { ?> <span class="aawp-box__price aawp-box__price--old"><?php echo $this->get_product_pricing('old'); ?></span> <?php if ( $this->is_sale_discount_position('standard') ) { ?> <span class="aawp-box__price aawp-box__price--saved"><?php echo $this->get_saved_text(); ?></span> <?php } ?> <?php } ?> <?php if ( $this->show_advertised_price() ) { ?> <span class="aawp-box__price aawp-box__price--current"><?php echo $this->get_product_pricing(); ?></span> <?php } ?> <?php $this->the_product_check_prime_logo(); ?> </div> <?php echo $this->get_button('detail'); ?> <?php echo $this->get_button(); ?> <?php if ( $this->get_inline_info() ) { ?> <span class="aawp-box__info"><?php echo $this->get_inline_info_text(); ?></span> <?php } ?> </div> </div> <?php endforeach; ?> I hope that isn’t too much hassle, thank you! How do I incorporate wordpress php usage withing standard php? For example, this is typically the template used for the title in wordpress: Code: [Select] <?php the_title(); ?> How would I show that in php, like: Code: [Select] $title = the_title(); //this doesn't work by the way |