|
|
楼主 |
发表于 2013-1-17 17:37:25
|
显示全部楼层
////////////////////////////////////////////////////////////////////////////////
7 p4 I$ a, v0 y8 u- G; C! M) w9 l// Theme Option( z4 f1 r4 u5 S4 q! _5 x) H7 ]) g
////////////////////////////////////////////////////////////////////////////////
( Q( O |$ S9 O- a3 _: T
* ~$ J5 a, e- [8 e$themename = "Zenx";
% ?" k9 E e$ v6 ^/ P. o, d9 q$shortname = str_replace(' ', '_', strtolower($themename));* ~# r3 U; T3 Q$ a6 _$ `
* U3 p& P+ ?) x1 X1 W/ x: |function get_theme_option($option). i6 F8 ] B5 X6 @
{+ R3 M! ~" W+ N$ {' |# c4 R6 u- l
global $shortname;2 Z; A$ }4 b5 Q {. P/ w
return stripslashes(get_option($shortname . '_' . $option));, O9 {1 d* L* p- X& c! k9 j6 n
}
+ _; R/ p |# |+ v+ S; a% ~) f) u7 j. l
function get_theme_settings($option)8 ?8 C) [. k2 p* n0 [" C% |) c( C
{
7 w% o" D: n ^6 {* k$ R return stripslashes(get_option($option)); ?! |/ {! A( Q. n, B: A
}, U: n9 U0 t9 u
$wp_dropdown_rd_admin = $wpdb->get_results("SELECT $wpdb->term_taxonomy.term_id,name,description,count FROM $wpdb->term_taxonomy LEFT JOIN $wpdb->terms ON $wpdb->term_taxonomy.term_id = $wpdb->terms.term_id WHERE parent > -1 AND taxonomy = 'category' AND count != '0' GROUP BY $wpdb->terms.name ORDER by $wpdb->terms.name ASC");! }+ Z' Y, [; ]5 h) R4 U
$wp_getcat = array();
- A" Q$ w6 U7 n: Rforeach ($wp_dropdown_rd_admin as $category_list) {8 A# X2 c& G. O5 R
$wp_getcat[$category_list->term_id] = $category_list->name;
6 A3 ]" Z" A) ?9 O8 V/ {' c}5 P% k, z1 o7 r5 O% H p6 L
$category_bulk_list = array_unshift($wp_getcat, "Choose a category:");; V6 S3 ]+ R( z6 g- a( o
$number_entries = array("Number of post:","1","2","3","4","5","6","7","8","9","10");
& ^7 c* U n$ R. l0 ?$crop_position = array("Choose Crop Position","middle","middleleft","middleright","topcenter","topleft","topright","bottomcenter","bottomleft","bottomright");
7 z$ ~% c0 E8 Q% I
) o8 H3 r( t$ b) B& W( ?. ~! W$options = array (
* ?" A' S$ H0 m* \
0 G. m9 d2 [: \. R" ~. M# K2 I `5 p s' L" t& p$ k, O! q @4 T" e
array( "name" => "Blog Header Settings",6 H+ P, x! S& v {0 l9 C' d
"type" => "heading",
) ^. _0 R4 ?( H& X m ),1 F( s$ ~) [+ K) h7 _+ Z l
$ o/ f u I3 m8 W' Q0 x array( "name" => "Use Custom Logo On The Blog Header?<br /><em>*Disable by default, Choose Yes to enable it.</em>"," |% C8 N, d, z) R
"id" => $shortname."_header_logo_activate",
! t7 x+ T( ?! |. r "type" => "select",
. Z0 g7 @& H# Z "std" => "No",5 Z9 _2 N: `( D/ ?) u& ?" {0 l
"options" => array("No", "Yes")),9 u4 A: s2 V: N8 n* n
5 F; _7 a. r, Q
array( "name" => "Insert The Full URL Location Of Your Logo Here <br /><em>*leave blank if not use</em>",
" H+ Z& E5 ]! B) Y9 Y8 Q6 t "id" => $shortname."_logo_url",
- \1 A9 H2 d4 y; G, y% p6 n1 x "type" => "text",
! d) a1 `$ }6 Y "box" => "social",
& o4 l; ?5 a" D* M& W$ r "std" => "",7 P$ H5 ^* L+ {& x3 r$ Y) n
),
" Y7 a1 ~3 c! J) y, E
: ?$ o3 k; q3 i4 s array( "name" => "Insert Header Banner HTML Code (Header)! N# H8 I8 S8 Y9 q9 k
<br /><em>*Recommended Size 468 x 60</em>
" x+ t5 e+ w: w$ O2 V/ d. F+ J <br /><em>*leave blank if not use</em>",; B8 O5 Z2 @) n2 A1 F0 m
"id" => $shortname."_header_banner",
8 Q& I( V3 Y! g "type" => "textarea",
$ Q8 m5 F! D& a" M) _( z! _' M "std" => "",5 p, L4 ^+ c, Y
),
0 d' y, e" t: O" ?; H% W: ~7 a$ F/ D( X; F3 A3 P- R% K
array( "name" => "</div></div>",
5 v T# Q; `! l: T5 [: m5 @ "type" => "close",
- a I# \9 x% e1 S8 {4 l ),
" E- S1 O) q, o6 X9 o/ C& _* a4 }) @
4 t+ X# D9 j$ O
array( "name" => "Header Navigation Settings",; U# o1 U7 l% [% C# `$ `
"type" => "heading",
& h# O3 y9 i! M! i1 J8 h ),: z d5 o8 G. [( b$ H( U
+ G. R3 U r1 \; e
array( "name" => "Insert Page ID To Exclude On Header Navigation<br />- j3 x. e; b: \
<em>i.e ../wp-admin/page.php?action=edit&post=<span class=\"redbold\">123</span></em><br />
4 z- u* b; F# v <em>*Enter the page post ID number only</em><br />
& g# w- [4 t t( u0 t; }/ y <em>*separate by comma</em><br />( @4 n: P$ k0 ^
<em>*Exclude pages which you don't want to show on the header navigation</em>",
! X+ C8 ]+ K% }0 ^6 E! _1 i "id" => $shortname."_header_page_navigation"," M/ ?* Y- `( U1 @& m
"type" => "text",
% r0 B7 y1 @/ w; } "std" => "", {4 k, ~; [* I
),
: f" t5 d) N+ W0 e
. ~- B' a6 A) m* I7 b3 s8 u array( "name" => "</div></div>",7 }2 M$ x3 \8 C
"type" => "close",9 M4 u2 r7 X! `
),7 c& L" `# _" m
2 i# E" u8 A; s) ?+ G- l
# j& E8 m9 m+ h* c array( "name" => "Post Auto Thumbnails Settings",* B' U& N7 q8 ]: ?
"type" => "heading",
% @+ R1 b) {# g1 k ),
( t6 v6 l0 N s! }" W8 | ) a% X3 W& x; y+ P* o/ i. f
array( "name" => "Use <strong>Timthumb Script</strong> For Auto Thumbnails?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
: [ z- l" h6 ^, _8 x "id" => $shortname."_timthumb_activate",
3 l+ `/ H; W( m6 N/ T, B y "type" => "select",
9 |. H# z' ~; w- a' @3 C "std" => "No",- l# n) J" h* X
"options" => array("No", "Yes")),0 ?) @/ d4 ^4 Q! z
9 r0 F/ F6 I' R array( "name" => "If Timthumb is enabled, Please choose its cropping method",2 K# z. N& I5 h8 l J0 n
"id" => $shortname."_timthumb_cropping",
; H! Z6 [3 a8 Z6 q: C( C# y "type" => "select",8 u( s" X. N) G/ s( a7 {+ r0 b
"std" => "",
! U1 K, c) S u D4 d8 D) r "options" => $crop_position),
9 ^0 E: e) b \9 B, a" b6 J0 u2 |4 F1 y% S3 n
array( "name" => "Insert Width Of Thumbnail Image<br />
& I9 ?$ j. x( N <em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br />, O. S: k- g G
<em>*Leave Blank To Use Default: 250</em><br />",
5 t! O2 L+ E. B6 `& w5 _% ~' M$ M8 A "id" => $shortname."_thumb_width",
# A/ {. @- b( d! a( C3 O "type" => "text",
$ R4 r' l8 Q% E6 G8 B' M8 Q "std" => "",3 B1 m6 t3 Q# W' f1 ?
),
5 ` h7 u4 ?+ q7 x
3 @) C. r* I# W0 c6 q6 } array( "name" => "Insert Height Of Thumbnail Image<br />
! q) ~4 ^1 D v3 \* N <em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br />
3 J- v2 H: {9 C2 Z( E: D <em>*Leave Blank To Use Default: 200</em><br />",
B( d8 @8 x! g+ \7 R; v2 {6 \; s( h "id" => $shortname."_thumb_height",; w6 b& U0 K! h k. t) N+ R" J# T
"type" => "text",8 l/ x# S y6 P3 ~
"std" => "",
. t/ w& c- o5 s7 V n ),+ J. \4 E) V+ U0 I( o7 [
* `/ P; l, h' t+ B; L) v array( "name" => "</div></div>",. A+ U3 _# u- E$ `' Z7 T
"type" => "close",/ n& d* _/ E& L0 x# O9 }
),8 x4 l q( J9 X+ H
$ U* \0 G3 W7 n( O, Q+ a, B* m
array( "name" => "Featured Content Slider Settings",2 J; e% o% d. H7 a, O( n
"type" => "heading",
" y4 A R! A' U' E) Z ),
5 p- b+ L5 v6 ?6 Q& R
: J9 e C: @; z9 d4 ?( o array( "name" => "Enable <strong>Featured Content Slider</strong> On Homepage?<br /><em>*Disable by default, Choose Yes to enable it.</em>",3 x/ f6 n m' ?# I' F# X/ w
"id" => $shortname."_featured_activate",, Y# F- D# S3 N
"type" => "select",
! ?" r* O; y; F2 B) h1 M( G& _ "std" => "No",
5 `8 N, S) [, C8 P, e- c6 M "options" => array("No", "Yes")),' p* L( p3 ]8 B! i" I4 `
( m! y' s/ z4 Y7 [
, I. v' B! j' {, y& m array( "name" => "Choose Which <strong>Category</strong> To Put On The Featured Slider?",
, a' k& |+ w7 _4 A( f1 V \- i. w "id" => $shortname."_featured_category",
4 _( P) z4 R2 \$ x9 n: v Y* K "type" => "select",- c& t: M$ g0 M. f1 F
"std" => "Choose a category:",2 r2 D% i8 c# |& l5 ]9 o
"options" => $wp_getcat),
9 |7 R- I6 [( y1 W* p# w+ K3 [- I7 O! s
array( "name" => "Choose How Many <strong>Post</strong> To Show On The Featured Slider?",/ J) O7 r( y9 R- L" X* |
"id" => $shortname."_featured_number",% F) U5 O& j$ t& ~) i
"type" => "select",# H2 f# m4 V, ^3 x5 y& u
"std" => "Number of post:",6 J8 q$ ?+ R5 N% C- g0 Z3 N% Y7 {
"options" => $number_entries),
7 t5 d- ^; V: \# l6 I3 z. u% _9 N4 \/ T- v
array( "name" => "</div></div>"," q+ j7 |! j, j; Y1 V
"type" => "close",
% [. }, b) n: _5 `& O3 @, x ),7 `# @! `) x9 N7 @3 Y* t1 P
4 J: D& W* l7 M! |/ [$ l) s1 T
array( "name" => "Featured Category Settings",
0 X% G$ D0 @- ^0 h% W. U "type" => "heading",/ o. \2 L$ Q4 r6 ~+ R
),
& v, X8 x8 f8 N6 c$ ]$ B8 c9 C# U( B6 x. u) A2 D* s/ K
array( "name" => "Enable <strong>Featured Category Showcase On Sidebar</strong>?<br /><em>*Disable by default, Choose Yes to enable it.</em>",. p J; v% q1 N% K1 A F
"id" => $shortname."_featured_category_activate",
1 g5 e- ~. \9 E \- q "type" => "select",
9 p$ m2 ]" u/ g/ @. g "std" => "No",
7 ~$ E) _" k4 z$ f' R4 H6 W5 P8 L "options" => array("No", "Yes")),
D3 x" e6 ?, N5 g4 F3 d 2 H+ r7 M" l) K& y' K
array( "name" => "Choose Category To Feature On 1st Block?<br /><em>*Leave it as default if not use.</em>",
+ S% \$ H+ r' m# J6 n "id" => $shortname."_featured_category_id1",
- N9 _9 N: I3 ~" s5 Q "type" => "select",. y# s, C/ [% ?0 h- h
"std" => "Choose a category:",0 r8 m( K7 R$ v- J5 m
"options" => $wp_getcat),
! z+ D$ {# e) B# ~! { ? v0 @( z2 w$ c* ]
array( "name" => "Choose How Many <strong>Post</strong> To Display On 1st Block?<br /><em>*Leave it as default if not use.</em>",; w4 ^# |2 S4 o
"id" => $shortname."_featured_number1",$ H! f: M' t7 m: |
"type" => "select",
& H8 K6 c5 D; n5 Z) `: U* {8 D1 @ "std" => "Number of post:",6 m/ q! _2 V; _: t
"options" => $number_entries),+ y" O) U. r ?' b6 d% z
7 C! O4 c c7 h9 D
array( "name" => "Choose Category To Feature On 2nd Block?<br /><em>*Leave it as default if not use.</em>",
& W6 T0 h( J" g7 h1 a "id" => $shortname."_featured_category_id2",1 j; K6 ^$ a7 x
"type" => "select",
: C3 X* p! W# a. u "std" => "Choose a category:",
2 l, a! s$ X' f. J% K5 b9 c "options" => $wp_getcat),: P( s$ m' c0 S! Q/ `1 S/ s
2 }3 u1 I. m/ B; I$ K) s1 \ array( "name" => "Choose How Many <strong>Post</strong> To Display On 2nd Block?<br /><em>*Leave it as default if not use.</em>",
, f; w) B U1 t6 `# L "id" => $shortname."_featured_number2", v+ m6 e% |: u1 ~" j
"type" => "select",$ t* b3 v* q" T3 M5 U# R& k) c
"std" => "Number of post:",2 |' |) |1 t8 M. c0 s, ^
"options" => $number_entries),0 m9 l' \) N) i4 j3 A. B; R7 z
" X$ d* G6 O& t
* P* ~' F7 a- u0 H( O- N array( "name" => "Choose Category To Feature On 3rd Block?<br /><em>*Leave it as default if not use.</em>",
0 O' |8 D8 y! {6 E: K6 R "id" => $shortname."_featured_category_id3",
. x% |: L- Z* G9 X "type" => "select"," P8 }; w. {9 [) y1 D
"std" => "Choose a category:",8 Q% W8 F6 r; _4 r5 u2 b
"options" => $wp_getcat),& s- g# S, o! }1 ?, H
+ h' v, y" E; H- C
array( "name" => "Choose How Many <strong>Post</strong> To Display On 3rd Block?<br /><em>*Leave it as default if not use.</em>",
" H: E ?+ x$ ]% W' ~ "id" => $shortname."_featured_number3",: ]! p( }! f$ c( F; ^
"type" => "select",9 J0 P- c q% F7 H
"std" => "Number of post:",' V C* y& d/ m
"options" => $number_entries),4 ]; x9 C& @4 s; C
/ u) Z/ ~% Y4 N/ t- `4 o
, m" q; f8 Z, B& e4 e
array( "name" => "</div></div>",
' E, V. A. c. P6 m: \) S "type" => "close",
4 X/ w2 D& i8 I- Z) Y, B ),
$ r! t' R% p$ @7 l& |
- q( M% W: i# [% n3 g. _3 {. G f% q" s, p. F
array( "name" => "Google Adsense & Analytics Settings",
3 _; ]6 o6 W i* @4 v "type" => "heading",8 P. [/ ^ \, h1 G4 i
),: N/ L: P& M+ i& |
* ]# i9 s; r0 | array( "name" => "Enable Google Adsense Loops Within Posts<br /><em>*default are disable, you can activate it by choosing enable</em>",. t+ C l" G6 ]( ~9 u4 _$ [
"id" => $shortname."_adsense_loop_activate",
5 G8 ~: f7 j) y& @ R7 J2 l( M "type" => "select",/ w1 q2 q N9 [5 @) B H
"std" => "Disable",& M" o8 J' c7 @
"options" => array("Disable", "Enable")),: h& L9 D6 H" k; K
$ j5 {- M" T+ `& t( U array( "name" => "Insert Google Adsense Code For Loops Here<br />
$ w. r6 @% ]5 w; m& _# r$ I% @, r <em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>",
C* k* P# v7 h( ? "id" => $shortname."_adsense_loop"," i. j) w0 t/ b% p& {
"type" => "textarea",9 F+ Z1 w* f8 [ W
"std" => "",
- b( m& ^& q8 k% h ),4 ~6 J8 p( h) Q# [
/ X# @. f( J% }; k; s
array( "name" => "Enable Google Adsense On Single Page<br /><em>*default are disable, you can activate it by choosing enable</em>",6 [7 J* s/ O- B+ Y& I( n& ?
"id" => $shortname."_adsense_single_activate",
' u9 s* C4 R# J% g" ` "type" => "select",# {) o+ E' b! E7 u2 P
"std" => "Disable",' R2 L/ l3 R8 m1 v2 N) C3 p# T
"options" => array("Disable", "Enable")),* B! V% Y6 u# M
' _, d7 G! n; @ @* A
array( "name" => "Insert Google Adsense Code For Single Page Here<br />6 U* R3 O8 [. {
<em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>",! E, P! j" I0 D' [: y( e# k" L
"id" => $shortname."_adsense_single",
8 P: i* D, m* P2 U6 L: d "type" => "textarea",! f Z% O& M; y- ?
"std" => "",7 [2 A1 T* G( S' \9 V
),
1 g! a& z( j8 X% p
0 V3 ]8 i2 e1 w# F+ @5 s9 K: ?
; r6 X* r+ B5 c% i4 a array( "name" => "Insert Google Analytics code <br /><em>*optional - leave it blank if not using</em>",
) |3 G' z+ X/ {3 x: h: _ "id" => $shortname."_google_analytics",
; H2 g: z' z% O "type" => "textarea",2 K0 I; w$ l2 A8 ~$ B
"std" => "",
, @7 x3 Z+ W& k5 x) n( u6 J ),& G7 w4 a8 U4 N8 u0 C* s( S
1 i* S7 }$ ]0 K1 M array( "name" => "</div></div>",5 N3 F5 a* | Z" ?- T" z9 v( v% r
"type" => "close",
7 ^/ F* T$ q7 d: c6 @: j4 A6 Y ),
: @! _7 G* t/ w/ h 1 _" I+ ^ k; Z4 c
. @5 L# p' O; M: u! e
array( "name" => "AddThis Social Bookmarking Settings",$ n. Q* [5 ]$ Q1 E p
"type" => "heading",( ^+ \1 u# z6 n
),, y4 q0 C; x: G, D4 G
, }3 l0 M$ a+ H/ _: ]5 y
array( "name" => "Insert you AddThis ID here (Only For Tracking Purpose) <br /><em>*leave blank if not necessary</em> l% F$ n9 w7 L6 x" |
<br /><em>*Get a Free AddThis ID <a href=\"http://www.addthis.com\" target=\"_blank\">here</a> if you don't have one</em>",) P+ _; m) L3 _, v. v" Q
"id" => $shortname."_addthis",
! E! L' U4 Q' U" o e "type" => "text",
, N) e9 N. [! ~$ W "box" => "social",) C0 R: Y; X* Y2 E$ P
"std" => "",& H) C, R/ }5 v! H% v E1 q! i
),
. A( A# j' U l6 w0 f$ R- c1 B+ r1 B0 }6 M# N& A' l+ u0 |
array( "name" => "</div></div>",
3 j) H$ b4 D& T' T) M/ ]! `" v "type" => "close",
# s( ?7 ?3 U( ~% H; M4 A ),5 @ q/ ~: r5 i8 ^( a; k6 N4 ?
3 F0 u+ V% s* s, e( [
) g' a9 p5 Q2 J: T R 4 z# \6 V8 B/ Z- Z% w
array( "name" => "YouTube Video Settings",
, ]$ y( `; g% s3 O d/ M3 @/ | "type" => "heading",
5 ]* n ^" W9 S& P$ l. J* l ),4 i" f( l$ S) G$ d7 o
) F! W% l# F# {: u! R! ] array( "name" => "Enable <strong>YouTube Video</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
% J O% Q! o3 O( @* t# x "id" => $shortname."_emvideo_activate",. [* J! ~' Y0 p. z2 j' G! @
"type" => "select",
: s: X7 a, e- p" x3 d: I. j0 s "std" => "No",. }4 N: X( W6 Q& A a; v
"options" => array("No", "Yes")),
3 h* k4 f W5 w3 P c
; w; m' \( o5 P9 P array( "name" => "Insert YouTube Video Unique Code<br /><em>*You can find videos to embed on <a href=\"http://www.youtube.com\" target=\"_blank\">YouTube</a> site.</em><br /><em>i.e. Youtube - http://www.youtube.com/watch?v=<span class=\"redbold\">Hr0Wv5DJhuk</span></em><br /><em>*Only Insert The Red Bolded Code Inside Below Setting Box.</em>",
6 M! Q/ v* l$ P+ [; m- u I "id" => $shortname."_emvideo",# L& ^8 y! @1 \
"std" => "",. Q2 [6 p" Q; F- c( d# A3 j4 S
"type" => "text"),8 n& `8 A# @% Y) b! N) U
0 N" G A2 } ^) T
array( "name" => "</div></div>",/ r' w n' `# t+ L/ C) {% V
"type" => "close",
+ r9 [) n {' n+ }! t/ a. i ),
/ V* v0 m& r- n7 `0 Z, r
/ M! [7 E" ?& t0 M+ Z4 _- m; G array( "name" => "Twitter Settings",9 j9 v) v2 \! m9 _3 D- _ P! X/ b
"type" => "heading",
. r2 v; m' F x4 b ),# a. s T; u% ~& s$ _
4 x" C0 u0 ?- u4 W2 R
array( "name" => "Enable <strong>Twitter</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
+ m* i5 n3 f! A8 } "id" => $shortname."_twitter_activate",8 t7 x6 W4 q2 m7 U5 K1 [
"type" => "select",
7 M, e: X9 t. J( H p9 a! z9 ? "std" => "No",9 [& M- F% E4 O7 E: f5 G
"options" => array("No", "Yes")),
g3 ~% @: ^( O
6 y6 P$ q+ f) b7 }. P ^+ j array( "name" => "Insert Your Twitter ID here$ r" V$ N$ t- M9 h
<br /><em>*leave blank if not necessary</em>7 \0 Q0 D/ Y* u0 A3 h
<br /><em>*Register Twitter for free <a href=\"http://www.twitter.com\" target=\"_blank\">here</a> if you don't have one</em>",
# n- J+ |5 o2 T" C9 v6 ]- A R "id" => $shortname."_twitter",# }9 W; |, C) \
"type" => "text",) J2 r+ V4 c3 o! T: K
"box" => "social",/ P1 x, g7 y' y
"std" => "",3 X/ G& V7 A& `
),
; b3 M4 `" I1 }0 A N4 s& u' F/ I& g, `3 i# z8 y
array( "name" => "Enter Twitter Feed Count here* |' b, ^* s+ h, {
<br /><em>*leave blank if not necessary</em>: H3 Z# T! r$ k2 Y6 n
<br /><em>*Enter How Many Twitter Feed To Display</em>",) R/ J% {' w) S, l
"id" => $shortname."_twitter_count",
2 Y& e' Z$ P! d5 h "type" => "text",7 ~2 ?0 j, N! _0 Z! ~$ A$ N
"box" => "social",' B+ Y" A: J+ I
"std" => "",
% E" b! Z, c4 w7 B ),
! f( Z8 G, E( F, k; D5 ~. g& _7 q, e6 t) ]
array( "name" => "</div></div>",. W# R- l1 o \8 b" M+ c" z) D$ S& p
"type" => "close",
& J+ i9 `( D* N$ b. {4 o ),
. ]4 j- x6 C4 r' n
( d3 _. F! s1 L' [
3 L+ z$ I6 s7 p+ t& q array( "name" => "125 x 125 Banners Advertisement Settings",
2 ^. N7 _5 Q, [; i# p6 ] "type" => "heading",
4 e0 N( O1 S: x- _ ),
, C8 E. V6 I/ k2 ?9 J$ \" z + Z+ ?. i/ I5 M, K% M3 Z
array( "name" => "Enable <strong>125 x 125 Banners</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
8 E& _# m. L. P9 i, N "id" => $shortname."_sponsor_activate",
/ w7 @9 e6 I& K2 x "type" => "select",
) y/ t m4 [/ D "std" => "No",. s, a7 A5 e. K7 ^9 {
"options" => array("No", "Yes")),9 F8 o6 g5 H/ ]) Y* B
" l6 w7 {0 P4 m* y, W! J; D4 ~( ^9 l- @
array( "name" => "Insert Sponsor Banner One HTML Code<br /><em>*leave blank if not use</em>",5 p9 w; E7 o* z4 c- O3 F# v9 }
"id" => $shortname."_sponsor_banner_one",
8 a2 o9 y. G* l. u; d1 v "type" => "textarea",3 _' j, `" R, {' R; y! u
"std" => "",
9 ^. V8 H; z6 Q6 S8 P ), 8 J- ?0 W: A5 d4 F D
8 t: ~8 v9 Y& F, e6 g9 N
array( "name" => "Insert Sponsor Banner Two HTML Code<br /><em>*leave blank if not use</em>",
. i% Q: \; _% i1 I" q Z3 D; u8 o "id" => $shortname."_sponsor_banner_two",
. \# F/ W. B8 q "type" => "textarea",
# a) `4 f7 l1 ^3 [ v+ _* F "std" => "",
+ l: C2 L, r3 E4 u2 c% f" d2 m ),
6 ?5 P" L( ?5 I \6 x
; r( h0 k8 @; W/ a* f2 w& o7 ?8 I array( "name" => "Insert Sponsor Banner Three HTML Code<br /><em>*leave blank if not use</em>",
: y: m7 ^4 h& ~3 c S- u "id" => $shortname."_sponsor_banner_three",
3 V# x9 |+ g1 x/ Y5 t "type" => "textarea",, c" r, T+ k: d: w
"std" => "",
0 y* Z7 J2 U% u( [2 M ),8 t' Z, A5 z2 T
9 ?. x. U6 i6 q6 h" R2 O3 q. ?
array( "name" => "Insert Sponsor Banner Four HTML Code<br /><em>*leave blank if not use</em>",
* U) ~( I8 P7 }1 T' p "id" => $shortname."_sponsor_banner_four",
& Z- ]' ^5 f) _ "type" => "textarea",' j6 R+ s. e2 t- Q& L& h2 n& }
"std" => "",. m* D8 `& R& U- {' i! B3 |' L
),* ]6 f% j/ D& Y9 ~7 k
) S6 I2 N- ]" o! X+ w array( "name" => "Insert Sponsor Banner Five HTML Code<br /><em>*leave blank if not use</em>",
3 R2 @. ]8 u& ]3 E/ |0 N "id" => $shortname."_sponsor_banner_five",
9 W1 h! A5 C4 @, ~# { "type" => "textarea",7 U% a7 V+ L: |: P: t- H
"std" => "",
! i* t" H% [2 T2 `, ]! l7 w: T ),
" ]' o. u; o5 M( O9 c* w3 Q) }- r. j2 D# x# P
array( "name" => "Insert Sponsor Banner Six HTML Code<br /><em>*leave blank if not use</em>",1 B, V* [& ^" w4 n) X
"id" => $shortname."_sponsor_banner_six",% O6 K. x% { V7 ~; B$ U% D: P. j
"type" => "textarea",
9 i& F' ~+ N% H9 i3 l "std" => "",' m. M8 ^" E3 Q# t7 J
),: j( b$ |$ t4 Y& y
/ p% N2 A3 R+ r: n5 _' q& ] T; N
array( "name" => "</div></div>",2 ^+ ?* [) S4 ?+ |: E( N
"type" => "close",: |0 w4 R7 P0 o& z
), [- f( s3 g# D p: T" i7 H9 \
& c: G% |% b5 Z
% T5 ^& d% h2 f) u! s+ q! a
9 p7 p( y8 e0 l" |);
0 B& d r i* s
2 {/ `( ^9 I/ n9 @function mytheme_admin_panel(){ if ((function_exists("check_theme_footer") || function_exists("check_theme_header"))) {1 q* {& o9 g" E! J! N3 b
" d8 [0 f2 `( z! r0 S1 F! d" D5 }9 ]
echo "<div id=\"admin-options\"> ";0 [, d/ Y2 X* b& v
1 Q5 x# n. R# K; i" I1 h+ K; hglobal $themename, $shortname, $options;
- R4 N* W: q# w* t9 g5 n% hif ( $_REQUEST['saved'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings saved.</strong></div>';& r$ ]& i: P7 u/ b8 v1 k
if ( $_REQUEST['reset'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings reset.</strong></div>';
6 A7 v) w9 x$ K# Q7 p4 a?>/ B1 a ^$ Z; ^* z# g
; Q' M, u$ |, {1 W8 r
<h4><?php echo "$themename"; ?> Theme Options</h4>
+ k) f' `, q4 b& p$ ^! U, |! s' F& m5 b% C$ s" W0 U
<div class="annouce">
! A6 E% o) Q) X<h1>Thank You Using Our <?php echo "$themename"; ?> WordPress Theme</h1>
1 J" B. l/ I3 a! w<p>Don't Forget to <a href="http://feedburner.google.com/fb/a/mailverify?uri=MagPress&loc=en_US" title="MagPress Newsletter" target="_blank" rel="nofollow"><b>Subscribe Our Free NewsLetter</b></a> In Order To Receive Theme's Updates and Fixes.</p>) d% c+ {. e. H7 M% \1 z9 M) U( c
</div>
# C% a& l* [7 @; x5 i% w1 J! O% G( j" {- k8 v
<form action="" method="post">
- x" Q% P! t. \+ t& P
* A/ Z" i& {5 j* Y; C0 b7 o* h<?php foreach ($options as $value) { ?>
6 s. N2 I. e8 B, `6 ]+ h6 ~% c" r4 b4 p1 ~
<?php switch ( $value['type'] ) { case 'heading': ?>
4 Y+ L' |$ b9 H X
9 j; l+ G/ s0 P, V/ J; }<div class="get-option">
6 p& }0 i& u) W& u3 Z9 C8 @9 b* _# y( ~
<h2><?php echo $value['name']; ?></h2>9 I/ G- @5 X/ Q
. e6 ?& `8 {( e' m% g0 l% H
<div class="option-save">" p9 k7 i2 |5 c: b: r
" I! @& o9 Q: Y
<?php' B+ Y# q/ e9 j) {; I) L9 K8 h
break;
4 H" u( c! j2 y+ G$ y( {case 'text':: X r) v x) l/ v0 Y0 {
?>
% F d4 j- _0 i1 \7 h" D
8 w- {& R! {$ p/ v( w5 ]( I<div class="description"><?php echo $value['name']; ?></div>
% R0 Q2 U* Y' H% z$ @! C<p><input name="<?php echo $value['id']; ?>" class="myfield" id="<?php echo $value['id']; ?>" type="<?php echo $value['type']; ?>" value="<?php if (
% f& \6 w2 i& P6 ~; R8 R( L8 n( M% u" j! U1 E
get_settings( $value['id'] ) != "") { echo get_settings( $value['id'] ); } else { echo $value['std']; } ?>" /></p>
9 @0 j# V) M* O( e
! ~) H: o% M" r+ w/ s& E<?php9 h' l) z1 `, V; n7 u/ K
break;
; t% N- v* j8 r" f7 fcase 'select':$ u/ @" w* A6 [
?>
7 g9 ` T/ y+ ]0 N5 H+ B. |( [& f- x' O2 B9 n
<div class="description"><?php echo $value['name']; ?></div>8 u8 y% D% m4 M& Y
<p><select name="<?php echo $value['id']; ?>" class="myselect" id="<?php echo $value['id']; ?>">
9 ^1 p/ H5 G) Q: v<?php foreach ($value['options'] as $option) { ?>
/ G! [/ f+ j- {# C6 ?<option<?php if ( get_settings( $value['id'] ) == $option) { echo ' selected="selected"'; } elseif ($option == $value['std']) { echo ' selected="selected"'; } ?>><?php echo $option; ?></option>
( \+ c p8 H. G8 N$ c<?php } ?>
/ \- Y# H: Z' t; Q2 k</select>
/ u& R1 I. ?" e, N" I; h" b</p>
- l$ ?: n3 I. g2 y+ Z5 v5 T; z, V- m# L: v! c" \! } K
<?php
; N+ J( a1 @* l# a6 Y* lbreak;9 d% d3 g# H2 y9 H0 C* l
case 'textarea':- u$ C0 V1 w! S ]; J4 t6 \3 L
$valuex = $value['id'];- a$ H( o2 u, Y; @+ h
$valuey = stripslashes($valuex);8 A4 D6 T2 O t* B
$video_code = get_settings($valuey);9 q& P; i1 w( g; h7 S' n0 M
?>! h. s" z6 f8 h+ D1 [1 f, q$ h- x
V% ]3 p' J' x+ c<div class="description"><?php echo $value['name']; ?></div>
. D$ u/ s+ q( z3 h6 e" |# C) ]<p><textarea name="<?php echo $valuey; ?>" class="mytext" cols="40%" rows="8" /><?php if ( get_settings($valuey) != "") { echo stripslashes($video_code); }
' y+ g" `5 C" I0 R( o( V
3 i% K( [! v, `/ [else { echo $value['std']; } ?></textarea></p>
) D0 t1 K5 b* d4 X* L5 Y3 F
' y m6 c2 M8 x3 G( h$ B* a, t<?php4 c& C0 D6 I- D( U; K' \) t
break;" r9 _( }0 D9 J- q, w# Y2 C
case 'close':
/ T/ Q) k( I+ O" U! ]?> A0 N1 v+ }/ f5 w% R
! {, I: r4 s& `8 b/ d( r: D<div class="clearfix"></div>3 F. S4 r- u1 M; C' j$ a* e
</div><!-- OPTION SAVE END -->
' K3 U; h& y8 {' C2 R
; u( W' u" ?* @<div class="clearfix"></div>
! ?% q. I! v j# p6 D</div><!-- GET OPTION END -->3 W+ M9 o, a; m
( x' G/ M+ B) P4 T* `, i5 O<?php
$ n1 R5 c K5 G9 Sbreak;
3 l* L( p+ ~8 h% w- W% Fdefault;
* ~- }0 B7 _, [8 o( W1 D?># \) k! P/ i6 `% i* w2 ^
0 A a1 B7 V" u5 a: _
, E' ?/ F' D# t W<?php3 t9 ^. K1 I a# }
break; } ?>6 v h/ A: \4 q
6 S+ H+ w! r* R. e0 a" Q2 @7 y/ K
<?php } ?>
7 A( N3 D; [0 F/ Q
& d7 b4 \$ b) c) N$ l<p class="save-p">5 h4 Q% K$ d6 H. a
<input name="save" type="submit" class="sbutton" value="Save Options" />
% k: t( P+ _2 S9 a) C ]2 R<input type="hidden" name="action" value="save" />
. f- i0 p. G/ w5 ~# S- ^' U& A</p>- e" \0 n# N7 z4 u( t* ?! _
</form>+ Z; ~; a% k; C' t# o ^ G7 M
0 h/ b2 n2 x( P# i5 Z
<form method="post">& S R a& E: M6 |) z4 l0 C
<p class="save-p">, g* h4 j* U# u$ L5 h" V
<input name="reset" type="submit" class="sbutton" value="Reset Options" />4 p( o; s# i2 i
<input type="hidden" name="action" value="reset" />2 @2 r* {/ L% R% v' g+ l
</p>: {% Z2 }* a+ h9 a6 o- D7 B
</form>/ T, j- i' l3 @2 C' S' t5 M
m) V4 V9 u/ D0 [
</div><!-- ADMIN OPTIONS END -->, o9 F' ^9 s0 U9 r- X
8 T) E* |5 c: Z<?php } else { echo ("Well, You Done It..You Just Modified Some Codes!"); } }
9 g( X) G+ _" z$ f X6 \' v% |! g
9 r& Z3 c0 n, Gfunction mytheme_admin_register() {+ T, t3 T- u( x8 `
global $themename, $shortname, $options;
0 p0 {) v: I' r% `# d [if ( $_GET['page'] == basename(__FILE__) ) {) G- _% S( f) o- |
if ( 'save' == $_REQUEST['action'] ) {
+ T& ~, M/ [5 Aforeach ($options as $value) {
t/ m3 N6 M* Zupdate_option( $value['id'], $_REQUEST[ $value['id'] ] ); }. N8 z2 t# E9 ^# b
foreach ($options as $value) {5 ?; `( e9 z! ]/ I$ G& N0 y' E5 w& M
if( isset( $_REQUEST[ $value['id'] ] ) ) { update_option( $value['id'], $_REQUEST[ $value['id'] ] ); } else { delete_option( $value['id'] ); } }; d j" c. |. O4 \+ E' R
header("Location: themes.php?page=functions.php&saved=true");( I+ A- I6 c Q
die;
( [2 w: \- l2 T4 l$ U5 N( S} else if( 'reset' == $_REQUEST['action'] ) {, ^+ f3 G% n1 ?
foreach ($options as $value) {
6 |4 w5 r$ g. Odelete_option( $value['id'] ); }- s. f, C+ W; T: }, x
header("Location: themes.php?page=functions.php&reset=true");0 `) {, Q9 t* V% j+ a/ x* ~; M. n6 v
die;
. _. {! Q! j- Z9 e! p6 G' G% t}/ J: M! t0 M! a! O
}
7 L+ d" Z& p4 |' {2 [add_theme_page($themename." Options", "Theme Options", 'edit_themes', basename(__FILE__), 'mytheme_admin_panel');6 x t9 g9 ^, E4 C# o6 P9 f
}
( \# i, T! n" r% X( c# E
3 [9 k3 o) t8 \( n; A2 n8 mfunction mytheme_admin_head() { ?>
# V K8 j- C. c1 l1 A5 ^<link href="<?php bloginfo('template_directory'); ?>/css/admin-panel.css" rel="stylesheet" type="text/css" />
, l; ~; |6 s8 y0 T: |<?php }
, V" m0 v. {# C6 e6 x$ z4 f |
|