Temos pavadinimas: WordPress, Shopify ir PHPFusion programuotojų bendruomenė :: adh klausimai

Parašė adh· 2010 Spa. 2 13:10:27
#1

Jei kils klausimų tai, kad ne flood'inti visus juos dėsiu čia (jei jie bus susiję su PHP).

#1 Klausimas:

TVS: WordPress

Įmečiau dizainą , jį įjungiau ir admin aplinkoje pačiame viršuje mane meta error:


PHP Error Message
 
 
Warning: mkdir() [function.mkdir]: Permission denied in /home/xxx/xxx/xxx/themes/thewhatsup/lib/admin.php on line 125


Susirandu admin.php failą:


123: $uploadDir = lp_get_upload_dir();
124: if (!is_dir($uploadDir)) {
125:  	mkdir($uploadDir, 0777);
126: }


Kaip suprantu kažkur turėjo būti sukurta upload folderis, tačiau nežinau kur ir kaip. Jei yra žinančių laukiu atsakymų.

Parašė Pakartoti slaptažodį· 2010 Spa. 2 17:10:52
#2

Kažkoks foleris nesuchmodintas į 777.

Parašė adh· 2010 Spa. 2 18:10:54
#3

Nu kaip suprantu tai upload, tačiau tokio net nerandu niekur.

Parašė Pakartoti slaptažodį· 2010 Spa. 2 18:10:22
#4

Iš ko tu sprendi? Šiaip manau čia reikia žiūrėti dar aukščiau..

Parašė adh· 2010 Spa. 2 18:10:33
#5


<?php
 
$includes = array(
	'lp_options' => LP_DIR.'lib/admin/options.php',
);
if ($_GET['page'] && isset($includes[$_GET['page']]))
{
	require_once($includes[$_GET['page']]);
}
 
 
add_action('admin_menu', 'lp_admin_menu');
 
 
 
// Add theme options menu item
function lp_admin_menu()
{
	$page = add_theme_page(LP_NAME.' '.__('Options'), LP_NAME.' '.__('Options'), 'edit_themes', 'lp_options', 'lp_admin_options');
 
	add_action('admin_print_styles-'.$page, 'lp_admin_styles');
	add_action('admin_footer-'.$page, 'lp_admin_scripts');
 
 
	if (defined('LP_OPTIONS') && (!empty($_FILES) || !empty($_POST)))
	{
		$fields = lp_admin_get_fields($_POST['prefix']);
		if (count($fields))
		{
			lp_admin_process_changes($_POST['prefix'], $fields);
		}
	}
}
 
 
// Add stylesheets
function lp_admin_styles()
{
	lp_print_script('admin', 'css');
 
	wp_enqueue_script('jquery');    
}
 
 
// Add javscripts
function lp_admin_scripts()
{
	lp_print_script('admin', 'js');
}
 
 
// Get admin page URL
function get_admin_link($type)
{
	return get_option('siteurl').'/wp-admin/themes.php?page='.$type;
}
 
 
// Reset cache files
function lp_reset_cache($parts, $ext)
{
	$dir = LP_DIR.'cache/';
 
	$d = opendir($dir);
	while ($file = readdir($d)) {
		if (is_file($dir.$file) && preg_match('~('.join('|', $parts).').*\.'.$ext.'$~i', $file)) 
		{
			unlink($dir.$file);
		}
	}
}
 
 
 
function lp_get_pages()
{
	$pages = get_pages(array());
	$levels = array();
	foreach ($pages as $item)
	{
		$level = 0;
		if ($item->post_parent && isset($levels[$item->post_parent]))
			$level = $levels[$item->post_parent] + 1;
 
		$items[] = array(
			'id' => $item->ID,
			'name' => $item->post_title,
			'level' => $level
		);
 
		$levels[$item->ID] = $level;
	}
 
	return $items;
}
 
function lp_get_categories()
{
	$categs = get_categories(array('hide_empty' => false));
	$levels = array();
	foreach ($categs as $item)
	{
		$level = 0;
		if ($item->category_parent && isset($levels[$item->category_parent]))
			$level = $levels[$item->category_parent] + 1;
 
		$items[] = array(
			'id' => $item->cat_ID,
			'name' => $item->name,
			'level' => $level
		);
 
		$levels[$item->ID] = $level;
	}
 
	return $items;
}
 
 
 
// initialize the upload directory
 
$uploadDir = lp_get_upload_dir();
if (!is_dir($uploadDir)) {
	mkdir($uploadDir, 0777);
}
 
 
?>

Parašė Pakartoti slaptažodį· 2010 Spa. 2 18:10:36
#6

Galbūt ji sukurta kažkur, pamėgink refreshinti. :|

Parašė adh· 2010 Spa. 2 18:10:08
#7

Visus failus pracheckinau, niekur nėra folderio "upload" ar kažko panašaus. Ir refreshinau, daug kartų. Nemėgstu tokių theme bug'ų.

Parašė edeni· 2010 Spa. 2 19:10:39
#8

Padaryk chmod 777 failą admin.php esanti themes/thewhatsup/lib/

Parašė adh· 2010 Spa. 2 19:10:41
#9

Nu kol kas tą problemą laikinai išsprendžiau (užcomment'inau kelias eilutes ir error'o nebemeta).

#2 Klausimas:

Noriu užmesti logo ant headerio kaip yra parodyta DEMO screenshot'e (THE WHATSUP!):



Štai header.php:


<!DOCTYPE <span style="border-bottom: 1px dotted black;">html</span> 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" <?php language_attributes(); ?>>
 
<head profile="http://gmpg.org/xfn/11">
<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>"/>
 
<title><?php wp_title('&laquo;', true, 'right'); ?> <?php bloginfo('name'); ?></title>
 
<?php lp_print_script('style,custom', 'css'); ?>
<!--[if IE 6]><link rel="stylesheet" href="<?php bloginfo('template_directory'); ?>/css/ie6.css" type="text/css" media="screen"/><![endif]-->
<!--[if IE 7]><link rel="stylesheet" href="<?php bloginfo('template_directory'); ?>/css/ie7.css" type="text/css" media="screen"/><![endif]-->
<link rel="stylesheet" href="<?php bloginfo('template_directory'); ?>/css/print.css" type="text/css" media="print"/>
 
<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>"/>
 
<?php if (is_singular()) wp_enqueue_script( 'comment-reply' ); 
?>
 
<?php wp_head(); ?>
</head>
 
<body <?php body_class(); ?>>
<div id="page">
 
<div id="top" role="banner" class="<?php echo (lp_config('menus_headerVisible') ? 'menu-visible' : ''); ?>">
	<h1 id="logo">
		<a href="<?php echo get_option('home'); ?>/"><?php bloginfo('name'); ?></a>
		<span><?php bloginfo('description'); ?></span>
	</h1>
	<div id="menu1" class="cf">
	<?php
		if (lp_config('menus_headerVisible')) :
	?>
		<ul>
			<?php lp_list_pages(array('menu_id' => 'header', 'title_li' => '')); ?>
		</ul>
	<?php
		endif; // if (lp_config('menus_headerVisible'))
	?>
		<div class="other">
			<p class="feed"><a href="<?php echo get_feed_link(); ?>"><?php echo bloginfo('name'); ?> Feed</a></p>
		</div>
	</div>
	<?php $GLOBALS['searchformLabel'] = __('GO'); get_search_form(); ?>
	<div id="menu2">
		<ul>
			<?php lp_list_categories(array('menu_id' => 'header', 'orderby' => 'name', 'after_link' => ' &raquo;')); ?>
		</ul>
	</div>
</div><!--/#top-->
 
<div id="wrap" class="cf <?php echo lp_config('layout_order'); ?>">