PDA

View Full Version : سوال: دلیل اجرا نشدن این بخش از کد چیست؟



premier
شنبه 24 مهر 1389, 18:37 عصر
سلام ببخشید در این قسمتی که علامت ؟؟؟؟؟؟ گذاشتم هیچ کدی اجرا نمیشه حتی php و جاوا اسکریپ
مشکل از کجاست چیکار کنم؟:عصبانی++::عصبانی++::عصبا ی++:


* Quick Preview tapestry callback function.
* @since 1.4.3
*/
if (!function_exists('arras_tapestry_quick')) {
function arras_tapestry_quick($dep = '', $taxonomy) {
?>
<li <?php arras_post_class() ?>>
<?php echo apply_filters('arras_tapestry_quick_postheader', arras_generic_postheader('quick-preview') ) ?>
<div class="entry-summary">
؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟ ؟؟؟؟؟؟؟؟؟؟؟
</div>
</li>
<?php
}
arras_add_tapestry( 'quick', __('Quick Preview', 'arras'), 'arras_tapestry_quick', array(
'before' => '<ul class="hfeed posts-quick clearfix">',
'after' => '</ul><!-- .posts-quick -->'
) );

function arras_add_tapestry_quick_thumbs() {
arras_add_image_size( 'quick-preview-thumb', __('Tapestry: Quick Preview', 'arras'), 115, 115 );
}
add_action('arras_add_default_thumbnails', 'arras_add_tapestry_quick_thumbs');

function arras_style_tapestry_quick() {
$quick_preview_size = arras_get_image_size('quick-preview-thumb');
$quick_preview_w = $quick_preview_size['w'];
$quick_preview_h = $quick_preview_size['h'];

?>
.posts-quick .entry-thumbnails img { width: <?php echo $quick_preview_w ?>px; height: <?php echo $quick_preview_h ?>px; }
.posts-quick .entry-meta { width: <?php echo $quick_preview_w ?>px; }
<?php
}
add_action('arras_custom_styles', 'arras_style_tapestry_quick');
}

binyaft
شنبه 24 مهر 1389, 19:14 عصر
در پی اچ پی اخر هر دستور باید یک ; بزارید اونجایی که کد اجرا نمیشه خط بالاییش با ; پایان نیافته
و خطا از همینجاست
اگر باز هم کار نکرد حد اقل خطا رو بزارید

premier
شنبه 24 مهر 1389, 19:24 عصر
یعنی کجا بزارم

این کل فایل


<?php

/**
* Container for storing tapestries and their hook to render them.
* @since 1.4.3
*/
$arras_tapestries = array();

/**
* Function to add posts views into the system.
* @since 1.4.3
*/
function arras_add_tapestry( $id, $name, $callback, $args = array() ) {
global $arras_tapestries;

if ( !is_callable($callback) ) return false;

$defaults = array(
'before' => '<div class="hfeed clearfix">',
'after' => '</div>',
'allow_duplicates' => true,
'taxonomy' => 'category'
);
$args = wp_parse_args($args, $defaults);

$args['name'] = $name;
$args['callback'] = $callback;

$arras_tapestries[$id] = (object) $args;
}

/**
* Function to remove posts views from the system.
* @since 1.4.3
*/
function arras_remove_tapestry($id) {
global $arras_tapestries;

unset($arras_tapestries[$id]);
}

/**
* Removes all posts display types from the system.
* @since 1.4.3
*/
function arras_remove_all_tapestries() {
global $arras_tapestries;

$arras_tapestries = array();
}

/**
* Gets tapestry callback function
* @since 1.4.4
*/
function arras_get_tapestry_callback($type, $query, $taxonomy = 'category') {
global $arras_tapestries;

if ( count($arras_tapestries) == 0 ) return false;

if ( $arras_tapestries[$type] ) {
$tapestry = $arras_tapestries[$type];
} else {
$arr = array_values($arras_tapestries);
$tapestry = $arr[0];
}

echo $tapestry->before;
while ($query->have_posts()) {
$query->the_post();
call_user_func_array( $tapestry->callback, array($dep = '', $taxonomy) );
if ($tapestry->allow_duplicates) arras_blacklist_duplicates();
}
echo $tapestry->after;
}

/**
* Traditional tapestry callback function.
* @since 1.4.3
*/
if (!function_exists('arras_tapestry_traditional')) {
function arras_tapestry_traditional($dep = '', $taxonomy) {
?>
<div <?php arras_single_post_class() ?>>
<?php arras_postheader() ?>
<div class="entry-content clearfix"><?php the_content( __('<p>Read the rest of this entry &raquo;</p>', 'arras') ); ?></div>
<?php arras_postfooter() ?>
</div>
<?php
}
arras_add_tapestry( 'traditional', __('Traditional', 'arras'), 'arras_tapestry_traditional', array(
'before' => '<div class="traditional hfeed">',
'after' => '</div><!-- traditional -->'
) );
}

/**
* Per Line tapestry callback function.
* @since 1.4.3
*/
if (!function_exists('arras_tapestry_line')) {
function arras_tapestry_line($dep = '', $taxonomy) {
?>
<li <?php arras_post_class() ?>>

<span class="entry-cat">
<?php
$terms = get_the_terms( get_the_ID(), $taxonomy );
if ( !is_wp_error($terms) ) {
$terms = array_values($terms);
if (arras_get_option('news_cat') && isset($terms[1])) echo $terms[1]->name;
else echo $terms[0]->name;
}
?>
</span>

<h3 class="entry-title"><a rel="bookmark" href="<?php the_permalink() ?>" title="<?php printf( __('Permalink to %s', 'arras'), get_the_title() ) ?>"><?php the_title() ?></a></h3>
<span class="entry-comments"><?php comments_number() ?></span>
</li>
<?php
}
arras_add_tapestry( 'line', __('Per Line', 'arras'), 'arras_tapestry_line', array(
'before' => '<ul class="hfeed posts-line clearfix">',
'after' => '</ul><!-- .posts-line -->'
) );
}

/**
* Node Based tapestry callback function.
* @since 1.4.3
*/
if (!function_exists('arras_tapestry_default')) {
function arras_tapestry_default($dep = '', $taxonomy) {
$tapestry_settings = get_option('arras_tapestry_default');
if (!is_array($tapestry_settings) ) {
$tapestry_settings = arras_defaults_tapestry_default();
}
?>
<li <?php arras_post_class() ?>>
<?php echo apply_filters('arras_tapestry_default_postheader', arras_generic_postheader('node-based', true) ) ?>
<?php if ($tapestry_settings['excerpt']) : ?>
<?php endif ?>
</li>
<?php
}
arras_add_tapestry( 'default', __('Node Based', 'arras'), 'arras_tapestry_default', array(
'before' => '<ul class="hfeed posts-default clearfix">',
'after' => '</ul><!-- .posts-default -->'
) );

add_action('arras_add_default_thumbnails', 'arras_add_tapestry_default_thumbs');
add_action('arras_admin_settings-layout', 'arras_admin_tapestry_default');
add_action('arras_admin_save', 'arras_save_tapestry_default');
add_action('arras_options_defaults', 'arras_defaults_tapestry_default');
add_action('arras_custom_styles', 'arras_style_tapestry_default');
}

function arras_add_tapestry_default_thumbs() {
$layout = arras_get_option('layout');

if ( strpos($layout, '1c') !== false ) {
$size = array(215, 120);
} else if ( strpos($layout, '3c') !== false ) {
$size = array(230, 130);
} else {
$size = array(195, 110);
}

arras_add_image_size( 'node-based-thumb', __('Tapestry: Node-Based', 'arras'), $size[0], $size[1] );
}

function arras_admin_tapestry_default() {
$tapestry_settings = get_option('arras_tapestry_default');
if (!is_array($tapestry_settings) ) {
$tapestry_settings = arras_defaults_tapestry_default();
}
?>
<h3><?php _e('Tapestry: Node Based', 'arras') ?></h3>
<table class="form-table">

<tr valign="top">
<th scope="row"><label for="arras-tapestry-default-excerpt"><?php _e('Show Excerpt?', 'arras') ?></label></th>
<td>
<?php echo arras_form_checkbox('arras-tapestry-default-excerpt', 'show', $tapestry_settings['excerpt'], 'id="arras-tapestry-default-excerpt"') ?>
</td>
</tr>
<tr valign="top">
<th scope="row"><label for="arras-tapestry-default-height"><?php _e('Maximum Node Height', 'arras') ?></label></th>
<td>
<?php echo arras_form_input(array('name' => 'arras-tapestry-default-height', 'id' => 'arras-tapestry-default-height', 'size' => '5', 'value' => $tapestry_settings['height'], 'maxlength' => 3 )) ?>
<?php ' ' . _e('pixels', 'arras') ?>
</td>
</tr>

</table>
<?php
}

function arras_save_tapestry_default() {
$_tapestry_default_settings = array(
'height' => (int)$_POST['arras-tapestry-default-height'],
'excerpt' => isset($_POST['arras-tapestry-default-excerpt'])
);

update_option('arras_tapestry_default', $_tapestry_default_settings);
}

function arras_defaults_tapestry_default() {
$_tapestry_default_settings = array(
'height' => 225,
'excerpt' => true
);
add_option('arras_tapestry_default', $_tapestry_default_settings, '', 'yes');

return $_tapestry_default_settings;
}

function arras_style_tapestry_default() {
$tapestry_settings = get_option('arras_tapestry_default');
$height = (!isset($tapestry_settings['height']) ) ? 225 : $tapestry_settings['height'];

$node_based_size = arras_get_image_size('node-based-thumb');
$node_based_w = $node_based_size['w'];
$node_based_h = $node_based_size['h'];

?>
.posts-default li { width: <?php echo $node_based_w + 10 ?>px; height: <?php echo $height ?>px; }
.posts-default img, .posts-default .entry-thumbnails-link { width: <?php echo $node_based_w ?>px; height: <?php echo $node_based_h ?>px; }
.posts-default .entry-meta { width: <?php echo $node_based_w ?>px; }
.posts-default .entry-thumbnails { width: <?php echo $node_based_w + 10 ?>px; height: <?php echo $node_based_h + 10 ?>px; }
<?php
}

/**
* Quick Preview tapestry callback function.
* @since 1.4.3
*/
if (!function_exists('arras_tapestry_quick')) {
function arras_tapestry_quick($dep = '', $taxonomy) {
?>
<li <?php arras_post_class() ?>>
<?php echo apply_filters('arras_tapestry_quick_postheader', arras_generic_postheader('quick-preview') ); ?>
<div class="entry-summary">
?????????????????????????????????????????????????? ??????????????
</div>
</li>
<?php
}
arras_add_tapestry( 'quick', __('Quick Preview', 'arras'), 'arras_tapestry_quick', array(
'before' => '<ul class="hfeed posts-quick clearfix">',
'after' => '</ul><!-- .posts-quick -->'
) );

function arras_add_tapestry_quick_thumbs() {
arras_add_image_size( 'quick-preview-thumb', __('Tapestry: Quick Preview', 'arras'), 115, 115 );
}
add_action('arras_add_default_thumbnails', 'arras_add_tapestry_quick_thumbs');

function arras_style_tapestry_quick() {
$quick_preview_size = arras_get_image_size('quick-preview-thumb');
$quick_preview_w = $quick_preview_size['w'];
$quick_preview_h = $quick_preview_size['h'];

?>
.posts-quick .entry-thumbnails img { width: <?php echo $quick_preview_w ?>px; height: <?php echo $quick_preview_h ?>px; }
.posts-quick .entry-meta { width: <?php echo $quick_preview_w ?>px; }
<?php
}
add_action('arras_custom_styles', 'arras_style_tapestry_quick');
}

/**
* Helper function to display headers for certain tapestries.
* @since 1.4.3
*/
function arras_generic_postheader($tapestry, $show_meta = false) {
global $post;

$postheader = '<div class="entry-thumbnails">';
$postheader .= '<a class="entry-thumbnails-link" href="' . get_permalink() . '">';
$postheader .= arras_get_thumbnail($tapestry . '-thumb');

if ($show_meta) {
$postheader .= '<span class="entry-meta"><span class="entry-comments">' . get_comments_number() . '</span>';
$postheader .= '<abbr class="published" title="' . get_the_time('c') . '">' . get_the_time( get_option('date_format') ) . '</abbr></span>';
}

$postheader .= '</a>';

$postheader .= '</div>';

$postheader .= '<h3 class="entry-title"><a href="' . get_permalink() . '" rel="bookmark">' . get_the_title() . '</a></h3>';

return $postheader;
}

/* End of file tapestries.php */
/* Location: ./library/tapestries.php */

binyaft
شنبه 24 مهر 1389, 19:58 عصر
کد زیر
<li <?php arras_post_class() ?>>
به صورت زیر
<li <?php arras_post_class(); ?>>

اگر باز هم کار نکرد ، خطایی را که میدهد اینجا بگذارید

premier
شنبه 24 مهر 1389, 20:28 عصر
اجرا نکرد

خطا نمیدهد ولی جای خالی میاد هیچ کدی را قبول نمیکند

funpatogh
شنبه 24 مهر 1389, 20:31 عصر
کد زیر
<li <?php arras_post_class() ?>>
به صورت زیر
<li <?php arras_post_class(); ?>>

اگر باز هم کار نکرد ، خطایی را که میدهد اینجا بگذارید
عزیز خطا مربوط به این ; نمیشه چون یک بلاک از دستورات تک خطی ; هم نباشه ایرادی ندارد

premier
شنبه 24 مهر 1389, 20:42 عصر
عزیز خطا مربوط به این ; نمیشه چون یک بلاک از دستورات تک خطی ; هم نباشه ایرادی ندارد


پس از کجاست چطوری حل میشه؟

binyaft
شنبه 24 مهر 1389, 20:49 عصر
error_reporting(E_ALL);
کد بالا رو در فایل مورد نظر کپی کنید ، ببینید چه خطایی میده ، خطا رو اینجا بزارید

premier
شنبه 24 مهر 1389, 20:53 عصر
هیچ خطایی نمیده! تا حالا همچنین چیزی ندیده بودم

binyaft
شنبه 24 مهر 1389, 21:20 عصر
کد رو چطور میزارید که اجرا نمیشه؟؟؟

premier
شنبه 24 مهر 1389, 21:39 عصر
کد رو چطور میزارید که اجرا نمیشه؟؟؟

کد را میزارم اروری نمیده

binyaft
شنبه 24 مهر 1389, 21:53 عصر
مطمئن هستید که کد هارو در ؟؟؟؟؟؟؟ درست میزارید؟
اون توابعی که استفاده میکنید ، داخل برنامه هست ؟

premier
شنبه 24 مهر 1389, 22:09 عصر
مطمئن هستید که کد هارو در ؟؟؟؟؟؟؟ درست میزارید؟
اون توابعی که استفاده میکنید ، داخل برنامه هست ؟

100% مطمئن هستم!

ولی کد جاوا نه ! آخه حتما این قسمت نباید که کد خود برنامه باشه !حتی کد عکس هم جواب نمیده

alasht
یک شنبه 25 مهر 1389, 09:46 صبح
سلام
دوست عزیز فکز نمیکنی این تابع یه جا باید فراخوانی بشه تا خروجی بده ؟

arras_tapestry_quick();
البته اگه اشتباه میگم به دل نگیرید :لبخند:

premier
یک شنبه 25 مهر 1389, 11:06 صبح
اصلا ! کد ها درست است هیچ مشکلی نداره ولی اجازه اجرا در اون قسمت را نمیده!

لطفا کمکم کنید!