How to Custome Wp Page Reading Query getting?

Below code for sameple custome page reading query.
Post Thumbnail URL Finding :

<?php //$mini_tennis_rewards_thumb = get_the_post_thumbnail($mini_tennis_rewards_data->ID, array(63,63));
$mini_tennis_rewards_thumb_src = wp_get_attachment_image_src( get_post_thumbnail_id( $mini_tennis_rewards_data->ID ), “thumbnail” );
?>

<a href=”<?php echo get_permalink($mini_tennis_rewards_data->ID); ?>”><img src=”<?php echo $mini_tennis_rewards_thumb_src[0]; ?>” /><span><?php echo $mini_tennis_rewards_data->post_title; ?></span></a>

<?php
$page_name = array(134,4778,4780,4782,4784,4786);

$privateCoaching_data = get_page($page_name[0]);
$proVideos_data = get_page($page_name[1]);
$calendar_data = get_page($page_name[2]);
$tipsOfTheWeek_data = get_page($page_name[3]);
$juniorPathway_data = get_page($page_name[4]);
$adultPathway_data = get_page($page_name[5]);
?>
<h1><a href=”<?php echo get_permalink($privateCoaching_data->ID); ?>”>Private Lessons</a></h1>

<img src=”<?php bloginfo( ‘stylesheet_directory’ ); ?>/images/privateLessons.jpg” />
<a href=”<?php echo get_permalink($privateCoaching_data->ID); ?>”><img src=”<?php bloginfo( ‘stylesheet_directory’ ); ?>/images/read-more.jpg” border=”0″ /></a>
<?php
//$privateCoaching_data_content = apply_filters(‘the_excerpt’, $privateCoaching_data->post_excerpt); // Get Content and retain WordPress filters such as paragraph tags. Origin from: http://wordpress.org/support/topic/get_pagepost-and-no-paragraphs-problem
//echo $privateCoaching_data_content;
echo $privateCoaching_data->post_excerpt;
?>

<!– Below line showes the post image –>

<?php echo get_the_post_thumbnail($mini_tennis_rewards_data->ID, ‘full’); ?>

This is line shows only for Image URL :

$thumbnail_src = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), "size" );

this is useful for custom post reader or page reader purpose.

How to Add a field into create account in Zencart?

Below Some Example i found i so this. This is useful for all.

1. You Go to PHPMYADMIN and select your database.
2.And Select your database inside the table “customers”.

3. Now you see the “Customers” table structure Right Side Screen. Example “customers_id”  Something like this.
And add your new filed this table inside. You can set here what type filed value need. Ex :
“VarChar”,  Collation = (latin), This type you can set.

Then You click  “SAVE”

4. Now You Open file includes/modules/YOURTEMPLATE/create_account.php
(Sometime this is controlling in includes/modules/template_default  inside. So where you have control this file you can take your template style via.)

5 . Now search for the following:
$firstname = zen_db_prepare_input($_POST[‘firstname’]);
Once you find out this, You can add your new filed this filed below or above.
Ex: [$lastname = zen_db_prepare_input($_POST[‘lastname’]);]

6. Next search for:
‘customers_firstname’ => $firstname,
Once you find out this, You can add your new filed this filed below or above.
Ex: [‘customers_lastname’ => $lastname]

7.  Now open file: includes/tamplates/YOURTEMPLATE/templates/tpl_module_create_account.php
Just add below type code which “LEGEND” inside that is your choice:
Ex :
<label for=”lastname”><?php echo ENTRY_LASTNAME; ?></label>
<?php echo zen_draw_input_field(‘lastname’, ”, zen_set_field_length(TABLE_CUSTOMERS, ‘customers_lastname’, ’40’) . ‘ id=”lastname”‘) . (zen_not_null(ENTRY_LASTNAME_TEXT) ? ‘<span>’ . ENTRY_LASTNAME_TEXT . ‘</span>’: ”); ?>
<br />

You want to change OR Add This type “ENTRY_LASTNAME”, You can go includes/languages/english.php inside. There the settings created.

8. Once You finished the above Section You go to admin/customer.php, Then Edit this file:
This file viewing the database details in your adminstator purpose.

Here you can find below type, once you got it you can add you field same below type :
a.) $customers_firstname = zen_db_prepare_input($_POST[‘customers_firstname’]);
b.) c.entry_country_id, c.customers_firstname, c.customers_lastname
c.) if (strlen($customers_firstname) < ENTRY_FIRST_NAME_MIN_LENGTH) {
$error = true;
$entry_firstname_error = true;
} else {
$entry_firstname_error = false;
}
d.) ‘customers_firstname’ => $customers_firstname,
e.) var customers_firstname = document.customers.customers_firstname.value;
f.) if (customers_firstname == “” || customers_firstname.length < <?php echo ENTRY_FIRST_NAME_MIN_LENGTH; ?>) {
error_message = error_message + “<?php echo JS_FIRST_NAME; ?>”;
error = 1;
}
g.) <tr>
<td><?php echo ENTRY_FIRST_NAME; ?></td>
<td>
<?php
if ($error == true) {
if ($entry_firstname_error == true) {
echo zen_draw_input_field(‘customers_firstname’, $cInfo->customers_firstname, zen_set_field_length(TABLE_CUSTOMERS, ‘customers_firstname’, 50)) . ‘&nbsp;’ . ENTRY_FIRST_NAME_ERROR;
} else {
echo $cInfo->customers_firstname . zen_draw_hidden_field(‘customers_firstname’);
}
} else {
echo zen_draw_input_field(‘customers_firstname’, $cInfo->customers_firstname, zen_set_field_length(TABLE_CUSTOMERS, ‘customers_firstname’, 50), true);
}
?></td>
</tr>

This type search. Then you can do this place in your field add. Then you will get good work. And more you can find insert here.

And more discussion going here :
http://www.zen-cart.com/forum/showthread.php?t=73181&page=2

Additional How to add CheckBox  in Zencart Form :
———————————————————————
<?php echo zen_draw_checkbox_field(‘wshop’, ‘1’, $wshop, ‘id=”wshop-checkbox”‘); ?>
<?php echo zen_draw_textarea_field(‘customers_WYOURMESSAGE’, ’10’, ‘5’, ”, zen_set_field_length(TABLE_CUSTOMERS, ‘customers_wyourmessage’, ”). ‘id=”customers_wyourmessage”‘) . (zen_not_null(ENTRY_BUSINESS_WYOURMESSAGE_TEXT) ? ‘<span>’ . ENTRY_BUSINESS_WYOURMESSAGE_TEXT . ‘</span>’: ”); ?>

Final Working Files :
——————————————————-
C:workfreelancerwww.yoururl.comyourfolderincludeslanguagesenglish.php
C:workfreelancerwww.yoururl.comyourfolderincludesmodulestemplate_defaultcreate_account.php
OR
C:workfreelancerwww.yoururl.comyourfolderincludesmodulesnew_templatecreate_account.php
C:workfreelancerwww.yoururl.comyourfolderincludestemplatestemplate_defaulttemplatestpl_modules_create_account.php
C:workfreelancerwww.yoururl.comyourfolderincludesform_check.js.php
C:workfreelancerwww.yoururl.comyourfolderadmincustomers.php
C:workfreelancerwww.yoururl.comyourfolderadminincludeslanguagesenglish.php
C:workfreelancerwww.yoururl.comyourfolderincludesmodulespagescreate_accountjscript_form_check.php <-- (JS Error Check UP File). Database name : Customers

© 2020 Spirituality