Jquery Mobile MYSQL call using PHP - php

We are currently building a mobile website using Jquery Mobile (1.1.0) and are using a multi-page template. We are using PHP to call MYSQL for dynamic content and have hit a brick wall with a certain object. When trying to call a simple image, it will not display. In viewing the source, it shows the correct image file name, however, it does not display. When removing Jquery Mobile, the image returns fine so I'm positive our variable is correct.
The code below is basically what we are using to call and echo out. ($data is an array with the page detail).
<div data-role="page" id="page">
<div data-role="header" data-position="fixed" class="header">
<div> PHONE NUMBER GOES HERE</div>
</div>
<div data-role="content">
<div class="logo">
<img src="img/logo.png" />
</div>
<h1>Page Title</h1>
<p>:: <span><?php echo $data['img']; ?></span> :: </p>
</div>
</div>
As stated previously, this code produces results in the page source but on the actual page it outputs <span> :: :: </span>. If anyone can help it would be much appreciated.

try:<img src="image_location/<?php echo '.$data['img'].'; ?>"/>

Place the PHP code inside
<div data-role="page" id="page">
// php code here
<!-- All the HTML goes here -->
</div><!-- End of #page -->
Its needed as the page content is loaded using jQuery AJAX call. In that case whatever code is there outside <div data-role="page" id="page"> will not get executed in the AJAX call.

Related

Creating form and form doesn´t show

I'm using contact form 7 plugins, I create form and then save the generated code in the contact page. But, in the preview page didn't show any form.
You just missed out the the_content function to call. Please add this code in your template file from container start to container end. Please check the HTML as per your design .
<div class="contianer"><!--container start here -->
<div class="row">
<!-- map column -->
<div class="col-lg-8 mb-4">
<!-- google map iframe goes here -->
</div>
<!-- contact details here -->
<div class="col-lg-4 mb-4">
<?php the_content(); ?>
</div>
</div>
</div> <!--container end here -->
<?php endwhile; endif; ?>
You need to add the Wordpress loop somewhere in that contact-us.php template, otherwise WP won't load what you define as content in the WP editor (which in your case is the content form)

Bootstrap grid not working when file is included

I already made a homepage including the grid system of bootstrap, but now im using mainly includes to keep everything tidy but the grid system doesnt seem to work at all. even if i copy the example code of bootstrap itself.
this is the first code of my content php file. including obviously the row part. These are stacked ontop of eachother not next to eachother.
PS: the .content-wrapper has no styling yet so its not affecting anything and the .content has only top and bottom padding.
<div class="content-wrapper">
<div class="content">
<h1>The Test Heading</h1>
<p>
text
</p>
</div>
<div class="row">
<div class="col-sm-6 col-md-6">
<div class="thumbnail">
<img src="..." alt="...">
<div class="caption">
<h3>Thumbnail label</h3>
<p>...</p>
<p>Button Button</p>
</div>
</div>
<div class="thumbnail">
<img src="..." alt="...">
<div class="caption">
<h3>Thumbnail label</h3>
<p>...</p>
<p>Button Button</p>
</div>
</div>
</div>
</div>
here is the index.php file i got with the content area
<div class="container">
<!-- Navigation area -->
<?php include_once ("php/navigation.php");?>
<!-- Carousel -->
<?php include_once ("php/carousel.php");?>
<!-- Content area -->
<?php include_once ("php/content.php");?>
</div> <!-- end of container -->
im not sure if it has to do something with including a file and the grid system, but carousel, container etc all working fine so it should find the css file after being included.
Sidequestion: is a method like this useful? working with includes only? or is it rather non-practical?
So what do u want to do with grid system, because you only have one col so it will just go from begining of file to col 6 it will look like it doesnt do anything rly? You can put lets say and then your div with col and it will move it and so on.

Links not working in Framework7

I'm developing a web-based application using Framework7 (http://www.idangero.us/framework7/).
I'm doing well but now that I have come to integrate my login/member system I have encountered a problem with hyperlinks.
I've spent couple of hours trying to figure it out but have still come up short.
Basically I have three links:
<div class="pages navbar-through toolbar-through">
<div data-page="index" class="page">
<div class="page-content">
<div class="content-block">
<div class="content-block-inner">
Hello <?php echo htmlentities($_SESSION['user']['username'], ENT_QUOTES, 'UTF-8'); ?>, secret content!<br />
Memberlist<br />
Edit Account<br />
Logout
</div>
</div>
</div>
Memberlist.php and edit_account.php do not work but logout does.
Visiting the files directly in my browser (eg domain.com/memberlist.php) loads the file. They just do not load from this page so something is clearly wrong with it.
I've tried to include target="_self" and use other styles of linking content as explained in the Framework7 documentation but there is nothing about the problem I'm experiencing.
it important to write exact page name in data-page attribute value
<div class="page" data-page="about">
After digging around some more in the documentation I was able to solve my issue.
Linking in Framework7 requires every page linked to to have some specific code for parsing over AJAX.
<!-- That is all we have in about.html file -->
<div class="page" data-page="about">
... About page content goes here
</div>

How to configure node on Drupal 7

There is a pattern node is inserted into the slider (in an item):
<div class="item"> <!-- Wrap contents -->
<div class="image"> <!-- Insert image-->
<img src="<?=file_create_url($content['field_img_slide_1']['#items'][0]['uri'])?>"alt=""/>
</div>
<div class="desc">
<h2><?=$content['field_h1_slide_1']["#items"][0][value];?></h2> <!--Insert title-->
<div class="info"><?=$content['field_h2_slide_1']["#items"][0][value];?></di><!--Insert title 2-->
<?=$content['body']["#items"][0][value];?> <!--Insert text -->
</div>
</div>
The code of the slider:
<div class="m-slider">
<div class="sliderBox">
<?php print render(module_invoke('views', 'block_view', 'flock_salon-block_1')); // These items are inserted for the slider ?>
</div>
</div>
When I have only one slide, everything is displayed perfectly. When I add the second slide, it is displayed under the first (incorrectly displayed)
Slider screenshot: http://i65.fastpic.ru/big/2014/0807/96/25ac215abd233ee409ed3dd6459ced96.png
The second slide lies on top of the first
What prescribe in the template node to fix slider displaying?
This most often occurs when there are errors in running javascript code or finding a javascript file/library. Open up your developer tools (F12 in most major browsers) and check the console for errors that may be halting your code before it gets to rendering the slider functionality.

How to place a header image above navigation in WordPress

I am using theme Banshee on (http://adriangraphics.com/truturf/) and can't figure out how to put a header image (as seen on http://globalsynturf.com/) above the navigation. I want my logo, along with phone number, etc above the navigation on my WordPress site. I'm assuming I have to change the Header PHP, but unsure how.
In your header.php find:
<div class="row">
Then inside of this find:
<div class="3">
<div id="logo">
Take the contents of this entire div, and cut it.
Then above the <div class="row">, make the following:
<div class="row">
<div class="span12">
<div id="logo">
//rest of the logo code
</div>
</div>
</div>

Categories