|
|

楼主 |
发表于 2013-1-17 17:37:25
|
显示全部楼层
////////////////////////////////////////////////////////////////////////////////
6 @; b9 b) N$ b6 \5 g: w// Theme Option) s4 L1 m; B+ N
////////////////////////////////////////////////////////////////////////////////* [8 e4 u: O. R9 ]% ~) g& E
; o' {) g- p) i3 R. y( Z/ X) R" J$themename = "Zenx";
% ] o* S" B |0 B) k+ S: v! L2 C$shortname = str_replace(' ', '_', strtolower($themename)); m! _' O) {0 E% C
. Y9 S6 ?' D: J/ n' Xfunction get_theme_option($option)
8 @8 p0 `4 B- B, Y( w: M{
: h0 J& t+ {% m global $shortname;
. T, J% v: G+ C return stripslashes(get_option($shortname . '_' . $option));$ L* d: ^+ N9 l' W4 [$ w5 z
}
) i: N* K- h6 C( H4 l: ]) I# o: J3 S( t
function get_theme_settings($option)
# y% y" l1 k' M; L8 ~{' H8 Q3 a3 Q+ N! R
return stripslashes(get_option($option));* l# \+ v& q* }2 ^+ y
}( J; ~3 x/ H0 J) V/ O
$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");
" U5 C2 X' _% l/ G$wp_getcat = array();
9 ?0 M- n5 d, E% `0 R7 \foreach ($wp_dropdown_rd_admin as $category_list) {) O- t# Y, j; w# O* o1 A
$wp_getcat[$category_list->term_id] = $category_list->name;
4 k3 Z# _+ d6 I. R6 D6 `}( P4 A4 H2 t: _
$category_bulk_list = array_unshift($wp_getcat, "Choose a category:");
, l* l3 D2 q Y" {4 e$number_entries = array("Number of post:","1","2","3","4","5","6","7","8","9","10");3 n& p& Q* I& j" C+ }5 ~
$crop_position = array("Choose Crop Position","middle","middleleft","middleright","topcenter","topleft","topright","bottomcenter","bottomleft","bottomright");, u) i# k" A6 ?
+ R& ^6 o7 w) K- z& s+ C
$options = array (
$ w! W: i$ K1 g( B9 G
p' y& C$ e) G! ~6 o. H8 J1 X- O1 R, t
array( "name" => "Blog Header Settings",
, z4 T; G3 Z; W, K "type" => "heading",
u; e4 Q2 X- T; H/ ^ ),* W4 q' _4 Z$ R6 y# N- ?3 @
8 a6 Z8 ]$ D, C' A: V2 {) m5 C array( "name" => "Use Custom Logo On The Blog Header?<br /><em>*Disable by default, Choose Yes to enable it.</em>",& V% {- L6 p' W# X/ Q3 J
"id" => $shortname."_header_logo_activate",
; ~/ ^* G! x' s/ c( y* n "type" => "select",
: G% U% Y6 F7 y8 [ o/ t "std" => "No",, Y8 z/ S1 S' K! {
"options" => array("No", "Yes")),
4 F0 g4 W: p) P5 Q1 N+ T2 y+ {- ^. F B8 j
array( "name" => "Insert The Full URL Location Of Your Logo Here <br /><em>*leave blank if not use</em>",
) _5 f5 n: k1 g/ z- [ "id" => $shortname."_logo_url",
3 D% g! ]3 E1 Y; A; \; K" O "type" => "text",/ I7 {5 G1 u9 B4 [
"box" => "social",
: F- ], }7 V8 B- K9 E/ M" x# y "std" => "",
- p# [2 ?$ q) K ),! q z: v. t4 t1 ~
+ d# V1 n+ B$ i" f+ d) G
array( "name" => "Insert Header Banner HTML Code (Header)9 o( G4 W7 o6 l; H& w4 R" F% V
<br /><em>*Recommended Size 468 x 60</em>' \' o1 ~/ _3 M$ U; Y5 m
<br /><em>*leave blank if not use</em>",; \/ O, P0 s/ x, [8 I
"id" => $shortname."_header_banner",
' A7 i$ E1 p' @1 N9 V0 b/ d "type" => "textarea",
8 {- Q$ ^; I- Q/ O2 } "std" => "",2 M+ g& ~3 g/ \7 A; L! N. H
),& y: l( X" ~4 l
4 K* J: ?) S; I' u' h
array( "name" => "</div></div>",
/ y5 \( p% L+ o0 |; c" p6 ^ "type" => "close",; M, y& D: t4 B% e/ L3 c
),
- v0 j) i. O* @5 V1 S: i# s% g a0 r2 H
! f j8 A6 t ?* ^4 D( T
array( "name" => "Header Navigation Settings",
. V. \* w+ i, R0 f "type" => "heading",6 ^( u$ l- I# f4 x8 p
),8 L: a8 _8 u( E9 w7 i" K( v7 g
2 D7 I/ A5 P6 M+ ?* W, ]8 @4 z2 A
array( "name" => "Insert Page ID To Exclude On Header Navigation<br />& f" u H( N2 W) i) P$ Q
<em>i.e ../wp-admin/page.php?action=edit&post=<span class=\"redbold\">123</span></em><br />
9 D" r5 n2 e; e <em>*Enter the page post ID number only</em><br />! V" j/ R4 |5 L5 }& P9 b
<em>*separate by comma</em><br />& x# e! y5 n& u6 ?/ w
<em>*Exclude pages which you don't want to show on the header navigation</em>",& V% k7 u! O7 H" f! | m. `3 r% a9 a
"id" => $shortname."_header_page_navigation",3 G& Y$ j3 s8 E
"type" => "text",
; K0 |5 }( V* s% g& ?) g "std" => "",
, w( [" j9 n1 p6 p. _* Z2 f' [8 G ),0 j3 ^0 O$ c6 e. c" r* r+ x
/ {4 V; q( z7 x! V8 q array( "name" => "</div></div>",5 M: T& s4 x3 C5 _0 S ]: a
"type" => "close",7 H* j% H$ L& f9 V( u; P% P7 j0 f- {
),7 o: L7 ^7 {4 T* Z
5 x4 s4 G8 O9 x `7 `
- Z5 v F9 l% [( w array( "name" => "Post Auto Thumbnails Settings",
' X0 h& s& O1 ?( l, [7 [$ X! n( l "type" => "heading",
6 E1 o6 X3 C$ D- z$ j! v1 R+ \ S ),
7 f" ^0 R$ H2 H
$ k( D( p( |" j* P8 s array( "name" => "Use <strong>Timthumb Script</strong> For Auto Thumbnails?<br /><em>*Disable by default, Choose Yes to enable it.</em>",: s! @" R* y5 L$ }3 X0 k q( P
"id" => $shortname."_timthumb_activate",
; ~/ D# n% H+ j4 N "type" => "select",
8 I& M8 r1 b b7 M# @5 N, c% x "std" => "No",: c% X# d6 @$ i- D3 W* M; Q: W" X' x
"options" => array("No", "Yes")),
+ @. K5 J# h% k) u' N, w 3 J: _9 V6 Z3 Y
array( "name" => "If Timthumb is enabled, Please choose its cropping method",7 U( f- p, q7 u* n
"id" => $shortname."_timthumb_cropping",3 `9 ]; X, M; o3 g
"type" => "select"," D9 p+ d+ t+ Y: z$ n$ N
"std" => "",
: [, w% O9 ]) @$ I" d: ^$ z "options" => $crop_position),
2 y) ?+ @1 o6 f9 Q" T3 ?5 I) t
; v. _: J* a4 W) p4 [ array( "name" => "Insert Width Of Thumbnail Image<br />& E% [/ T+ T8 q
<em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br />& P2 ]0 r9 _1 ]! G3 K( R
<em>*Leave Blank To Use Default: 250</em><br />",$ {& q- o! C% |+ @5 {3 ?# o3 c
"id" => $shortname."_thumb_width",
4 N1 V5 w* M8 q+ s' a8 i- | "type" => "text",
- I# X6 T( d6 O$ a( q2 Z0 {1 [ "std" => "",
% _! k/ e. f! b2 i1 _+ ^( C/ ~ ),& f, j/ N) R; `1 ~: X `9 \
$ F4 @5 f7 P4 F; V) g& b array( "name" => "Insert Height Of Thumbnail Image<br />
* T. D6 S6 _) w/ j <em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br />
- Z3 H! E- x A% p% N <em>*Leave Blank To Use Default: 200</em><br />",4 W0 z1 }5 O3 n
"id" => $shortname."_thumb_height",% \, ?9 S" X- }
"type" => "text",
- T% I9 U9 k: p% ] "std" => "",
8 t+ n% v( ?# w! s ),# Z! X6 H# C4 M
7 K- X. Y9 z& h! l' @$ r/ V array( "name" => "</div></div>",
9 R- L9 _3 o# ~0 k: z0 L+ h: ^ L0 T "type" => "close",
, y9 v/ z/ G' l& F- h3 e7 e ),9 Z' e- ~% A" D/ l7 l2 v( G
/ }' ]+ L6 A' f/ Q5 r+ U% D array( "name" => "Featured Content Slider Settings",
" H) G$ f. m$ U& ] "type" => "heading",
D7 }9 T9 |# O ),
* L! M# L2 {1 J5 L0 S- e; c5 ?7 t2 W1 A7 R" ?3 S! k
array( "name" => "Enable <strong>Featured Content Slider</strong> On Homepage?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
- W& Q/ M$ U& \ "id" => $shortname."_featured_activate",1 I! W, K W) o
"type" => "select",% k) ^+ B5 s ?" I% h
"std" => "No",
. a E( |. H2 p6 ]6 \ t% O "options" => array("No", "Yes")),
3 O" d; {9 l3 _4 z/ \! c6 w' K6 t: s+ {
; t& K7 U6 ~, }' e* G array( "name" => "Choose Which <strong>Category</strong> To Put On The Featured Slider?",- c" n6 C' F- ?5 ^" u# K
"id" => $shortname."_featured_category",
3 h8 u) G: A, B2 \1 O "type" => "select",6 \# `! B' |8 u2 Z9 z+ h4 L3 j" Z
"std" => "Choose a category:",
$ Y+ |) l0 t% A "options" => $wp_getcat),
# c% `' _8 ?( w2 n6 D9 U, X( V; c- D7 j4 j
array( "name" => "Choose How Many <strong>Post</strong> To Show On The Featured Slider?",
5 P( v& K& I: B/ o5 i! J& e "id" => $shortname."_featured_number",+ p9 _! g/ m2 t4 ?+ E
"type" => "select",
. U1 L5 w0 G3 w& [ "std" => "Number of post:",
% }7 Z: }, s; j" p; a& [1 b% @5 R "options" => $number_entries),, k) @ _6 }) A9 k% Y* e
0 u/ S- Y2 ~! i
array( "name" => "</div></div>",
* z# _) t5 l* E8 z- ` "type" => "close",
5 L2 c$ P* N4 l1 S ),9 K* F) |* x3 S! }+ v) N, Q
7 x2 W" Q: d; O2 z array( "name" => "Featured Category Settings",7 h3 z+ R8 v7 T- t5 Y5 ?* i
"type" => "heading",! y- }) k L# K* P4 v
),( Z, L1 s: C& O* W
( M) |6 c+ u6 Z( j7 ^) u array( "name" => "Enable <strong>Featured Category Showcase On Sidebar</strong>?<br /><em>*Disable by default, Choose Yes to enable it.</em>"," E& f! {3 f1 D# Z! ]9 p% F
"id" => $shortname."_featured_category_activate",# E9 ~+ Q. A6 c+ V' u- X" c
"type" => "select",: f8 l+ v1 g' [* x
"std" => "No",7 ?( L4 d9 c2 n
"options" => array("No", "Yes"))," x- J! s; [! }- {
6 y& U0 d6 N5 H+ z array( "name" => "Choose Category To Feature On 1st Block?<br /><em>*Leave it as default if not use.</em>",) `- l2 l% S& B8 z
"id" => $shortname."_featured_category_id1",' ^$ ]- W2 S, S& F
"type" => "select",2 G6 N) y. j. T' ^
"std" => "Choose a category:",
1 t" K9 r% t- v# @% D* @( P "options" => $wp_getcat),
7 E5 p9 d- K# q ' w) @ Q, t& R |
array( "name" => "Choose How Many <strong>Post</strong> To Display On 1st Block?<br /><em>*Leave it as default if not use.</em>",& a+ Y$ ~- ?0 ^- ?6 @
"id" => $shortname."_featured_number1",% E; s: }' @1 \1 Y# S
"type" => "select",
7 C' Z( G& a9 j m: w "std" => "Number of post:",, K5 \* q0 m. a9 `
"options" => $number_entries),
, s" S+ a. b8 h" Z6 f* X ! D0 ~ l$ m: v' X: }/ u+ y. S
array( "name" => "Choose Category To Feature On 2nd Block?<br /><em>*Leave it as default if not use.</em>",, U) z1 f1 u3 l
"id" => $shortname."_featured_category_id2",' \5 ^4 q- t# a8 ~, c L
"type" => "select",
* m/ e# J7 U2 |6 X1 j. l "std" => "Choose a category:",9 k; y" q6 S/ A& `
"options" => $wp_getcat),* n% P" Z" J+ p% ?1 M( y
" p+ Q( I7 g% J; u array( "name" => "Choose How Many <strong>Post</strong> To Display On 2nd Block?<br /><em>*Leave it as default if not use.</em>",8 ?2 c3 l# I" c, U' B
"id" => $shortname."_featured_number2",
. S) |$ T7 I& S/ v+ ?1 n "type" => "select",1 d2 p* S( P: f2 j1 l, l P
"std" => "Number of post:",+ k8 e8 z" y1 D& N
"options" => $number_entries),
+ B6 r' m6 B6 D5 O0 O5 R
& c) c3 A' I6 ? l( E% m9 _! M
7 p6 {4 y8 K: R0 K5 N6 L array( "name" => "Choose Category To Feature On 3rd Block?<br /><em>*Leave it as default if not use.</em>",! n/ N2 H% E" Y, G- o! t" t
"id" => $shortname."_featured_category_id3",
, }: u8 `! T! Y& L "type" => "select",
- P, h# ~) l- q& [$ X1 B' U+ n "std" => "Choose a category:",
/ c& K0 t5 x$ O" B$ H "options" => $wp_getcat),+ K; a1 r9 z( S& B% z
5 ^) v8 p7 ~. t+ V array( "name" => "Choose How Many <strong>Post</strong> To Display On 3rd Block?<br /><em>*Leave it as default if not use.</em>",/ O2 T) u6 b0 T1 Q, J2 K
"id" => $shortname."_featured_number3",
4 d+ E6 i5 v! s/ i "type" => "select",
7 C' u \& `8 ? "std" => "Number of post:",! e& Y' ]# B3 f" D) p
"options" => $number_entries),9 Y6 t6 k' S: y0 r
J! {2 s4 J3 u9 h1 D% _
. K4 W, p8 S, U) s! i2 @
array( "name" => "</div></div>",* b# u( T2 g5 v9 o( |
"type" => "close",
% ^: I3 R- H) [. |6 `/ ^4 u2 T ),+ g) S8 D* W9 U) c8 z( D' ~
+ v' Y! e+ ]) V, `2 t" S
: m: i, C6 R c8 i0 o* p7 b& n1 m array( "name" => "Google Adsense & Analytics Settings", r8 p0 Y9 f! e9 H4 W6 k9 u
"type" => "heading",3 N* i; p% r1 z; G
),
0 m1 _5 v; g" n6 c4 J! @
6 y& `" i# @9 @# t8 v array( "name" => "Enable Google Adsense Loops Within Posts<br /><em>*default are disable, you can activate it by choosing enable</em>",
( p/ A9 P/ ?# u K- V "id" => $shortname."_adsense_loop_activate",
j9 W7 c4 i/ C# B2 H "type" => "select",
) a2 ]$ D. E- k( l2 o1 K5 P "std" => "Disable",
) j- S% b: V; m: q& s1 ~. j "options" => array("Disable", "Enable")),
6 C& N. u: b$ B# @$ F7 p0 W/ q+ K0 v I+ b
array( "name" => "Insert Google Adsense Code For Loops Here<br />: j" J- @0 X0 V. t2 `
<em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>",9 u R! u: P% |2 E; v9 P; d
"id" => $shortname."_adsense_loop",% p e+ ]* y- T3 O# X
"type" => "textarea",# n$ ^3 y" C' R! p( t
"std" => "",
$ u/ I2 J8 {7 a7 q( l9 C" t, d ),
* q" J, B' Z2 f9 ?9 p/ U2 |# P: Q: p) E& Y
array( "name" => "Enable Google Adsense On Single Page<br /><em>*default are disable, you can activate it by choosing enable</em>",
- u: {! A0 b& a4 H E) {1 X* w "id" => $shortname."_adsense_single_activate",
& r8 n2 b, J( U1 z9 V "type" => "select",
$ J0 @' T; ^# B! t" u7 e "std" => "Disable",& H7 x4 P7 T5 f$ {- w
"options" => array("Disable", "Enable")),: A* A1 E# k9 b" P) z7 y/ n: {; H
! {6 z: u6 O {
array( "name" => "Insert Google Adsense Code For Single Page Here<br />
6 A0 j% L6 W( x' [0 ~# Z# Q <em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>",
; v/ G- S% W- w( q9 C) |7 h5 _ "id" => $shortname."_adsense_single",
; h) k% v0 T4 Q5 ? "type" => "textarea",
! p- e8 ]3 `; {( K. F+ z1 H1 B9 h! s "std" => "",7 ?# ~2 U1 S( t3 z
),
, F8 H# O x9 T- \: m6 m* @; [8 Q1 Y& i
, P2 L: M" M: y: x% w: R: p Q$ c5 W array( "name" => "Insert Google Analytics code <br /><em>*optional - leave it blank if not using</em>", U7 B+ X- N; D
"id" => $shortname."_google_analytics",
! g5 i$ c' `- ` "type" => "textarea",
3 l. U' P8 r; w2 y" Y: u& G "std" => "",8 F; O3 d+ R) M- _: x5 x: p/ g' K
),7 e; n7 n& V9 @( ]) o& r
9 l/ E$ i, I) _) \: T; x$ \# ~ array( "name" => "</div></div>"," n1 X' X/ [" o+ K* f5 f
"type" => "close"," r4 c: y j4 R; h& e m
), B; i: s( `* q, V$ U' ?1 `
8 v7 ^8 o! Y. C0 v1 G( \3 B' n( `
2 j: p/ O( _% B, l" N" m, y array( "name" => "AddThis Social Bookmarking Settings",
, V# y8 d; |5 p i! V8 f; {% U "type" => "heading",
3 Q; L" K: P, b. Y' z# [ ),
0 g) W" s6 p0 K, D2 u: O2 ` p$ s ?, [7 C! t: i$ U
array( "name" => "Insert you AddThis ID here (Only For Tracking Purpose) <br /><em>*leave blank if not necessary</em>9 l3 B7 ]" [. w- [' {( [8 B* T
<br /><em>*Get a Free AddThis ID <a href=\"http://www.addthis.com\" target=\"_blank\">here</a> if you don't have one</em>",
; s$ c0 R" c5 Q' }# A b7 D "id" => $shortname."_addthis",, n, W7 p* R& c# n; r3 L M2 A
"type" => "text",9 O: q/ ^, S. y2 w
"box" => "social",
0 `6 ^% d8 o9 v& [ "std" => "",
A5 X; c x7 s5 m. ^ ),$ M$ H; N8 n" m/ a8 ~1 h
% V: h; a5 K: N' u
array( "name" => "</div></div>",
* }1 e1 B- ~8 y, G; A; l "type" => "close",
9 Z3 J$ k: |; w- g3 L3 O( @ ),7 z* ?8 K8 D: A
3 F* Q( s) G& C; l, u8 g- a5 _
& }# `4 ]. R0 J/ ^1 a 3 S; i( N" [. e( c
array( "name" => "YouTube Video Settings",$ x6 }5 v+ m& o
"type" => "heading",7 Y/ g6 D2 G$ z* C4 Y+ o
),5 e- _- V, u$ W4 _7 i
3 B7 x4 K$ S" y! ^& E
array( "name" => "Enable <strong>YouTube Video</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",% u, Z/ Q* `! h0 P
"id" => $shortname."_emvideo_activate",* [, ~. _* }5 P" k) A% A+ ?
"type" => "select",
+ r$ p5 B6 w6 T% ~ "std" => "No", m k- R/ {9 Z+ Z- a" U# j
"options" => array("No", "Yes")),
5 h7 w+ X$ `$ X b! c- K1 ~
3 u$ ~. A$ \8 y' w* C+ J 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>",( a- ?' Z" S8 u& l$ F, e
"id" => $shortname."_emvideo",
/ d1 W: `: i, S6 v& M "std" => "",6 V; z9 r- y% q* f' I
"type" => "text"),
3 h" C1 p R9 P6 c, [+ }2 d1 S1 g1 ^
array( "name" => "</div></div>",
& ^. W- h- G/ H4 |/ W "type" => "close",6 y _9 B% t% a2 s6 V
),/ p. y' c3 a% T k: i
" C1 w1 H5 ]2 W& b& O array( "name" => "Twitter Settings",# Q$ H' X0 k: h8 S7 V/ e5 B
"type" => "heading",
$ m. V6 }3 N4 Q% [, e" } ),5 A! a7 o) y# `3 [
* b% T$ Y( W' I2 V& ?' M# \
array( "name" => "Enable <strong>Twitter</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",; b; t/ I @& F$ @! F1 ~, J0 l
"id" => $shortname."_twitter_activate",
0 u) v: | n5 y "type" => "select",4 d! V' _" Z$ S- ]! S
"std" => "No",
/ f7 t! p2 \# S8 ^ "options" => array("No", "Yes")),! p3 A& i0 B. A, n @& _
, u- y9 d- A$ D* c; v0 B8 } array( "name" => "Insert Your Twitter ID here
; }/ K* H/ }9 i/ m3 Z/ Z* b <br /><em>*leave blank if not necessary</em>
) l) l, W) e3 ~- I4 E <br /><em>*Register Twitter for free <a href=\"http://www.twitter.com\" target=\"_blank\">here</a> if you don't have one</em>",! {$ m8 m0 X" P5 k7 ]6 i
"id" => $shortname."_twitter",
$ @9 l, b0 c3 K& [+ u "type" => "text",
) z6 {8 `4 h _+ Y" z* D4 s "box" => "social",
& u- Z) x! @1 ?. E, G p4 y7 p "std" => "",' P- \% Q& c( Z# B% V, ~
),
" g0 p% {/ g1 M$ D$ R# ]( x \
0 f& r) ^. s: T4 x; _ array( "name" => "Enter Twitter Feed Count here) z, ]" I9 d- j8 a, G+ i
<br /><em>*leave blank if not necessary</em>
' T" R$ T* E) b" g) D: y: t( v <br /><em>*Enter How Many Twitter Feed To Display</em>",
. D: Y3 W8 i: U k" }" d( T "id" => $shortname."_twitter_count"," l0 {$ n" ?5 k% H8 ?, m0 c( z0 G
"type" => "text",) r2 ^# G6 D6 p2 A
"box" => "social",) [3 D% r$ o" c, Y( o& i T5 e
"std" => "",
, P4 B! ?! e6 [' D$ h ),
4 @- Q; k7 ]. _' | x( b) \- }; ]* h7 ~) e t' N
array( "name" => "</div></div>",, [. d8 B2 p% f
"type" => "close",/ y4 [+ y+ R$ P9 T0 E
),, w8 _* n9 M' g/ M
7 H0 c3 `% K+ @6 W2 {7 r; k
# c# B0 `: S: l7 z$ ` array( "name" => "125 x 125 Banners Advertisement Settings",2 Y/ y4 T6 }7 ]
"type" => "heading"," m) d3 y6 P& W( U8 n9 u
),1 A1 U) f8 s) Z' H. @
& K9 k: m% e/ j2 [9 n
array( "name" => "Enable <strong>125 x 125 Banners</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",, G5 T6 y" D6 P) R# y- s2 f" d _1 q2 Q
"id" => $shortname."_sponsor_activate",
' r8 g3 f1 T' d$ W ]$ `1 v "type" => "select",. L3 O2 J0 f+ `) i+ P
"std" => "No",
2 x% n5 i% @, m; D4 V; ^) \! m "options" => array("No", "Yes")),/ e9 j9 R3 J; Y/ a- H$ a
& A# U& O* v6 [! R
7 D, Z6 |, s( y% M/ y" W
array( "name" => "Insert Sponsor Banner One HTML Code<br /><em>*leave blank if not use</em>",; {4 D, M6 ~8 T, M
"id" => $shortname."_sponsor_banner_one",- i7 B# D! L5 Z# {
"type" => "textarea",
' R3 ], a3 {! U, ^% Z "std" => "",
. y, ^" L7 g1 f9 H9 S: z ),
5 J5 j2 }% |- I% c, l1 |% A% C, T8 ^# n8 X" R5 w" Z
array( "name" => "Insert Sponsor Banner Two HTML Code<br /><em>*leave blank if not use</em>",
( o" @/ _% g, a0 ` "id" => $shortname."_sponsor_banner_two",
3 ~* F0 _9 T6 f9 L |3 l- c6 p "type" => "textarea",
+ Q3 }3 s+ J7 I. v1 X "std" => "",
) _" T6 R% `4 T) ^2 G! j ),
; o4 Y1 N$ v; f, ?6 Z7 C: C! J3 A; I, s+ {+ h- `3 Y# k
array( "name" => "Insert Sponsor Banner Three HTML Code<br /><em>*leave blank if not use</em>",
" J, S& b) i7 g' Q- j "id" => $shortname."_sponsor_banner_three",
0 c x# Q' T; G- | J! w "type" => "textarea",
) \( ^- X% A% L; ~, Z4 k "std" => "",
) S2 z5 v4 M2 T( } ),
9 D8 ?% [% v; J3 [& @" u2 F8 x; s G$ [& y( f* Y& \
array( "name" => "Insert Sponsor Banner Four HTML Code<br /><em>*leave blank if not use</em>",
! M* ~% y# J8 x: m2 z "id" => $shortname."_sponsor_banner_four",
1 z% s" E9 v$ m& c "type" => "textarea",: m7 l% b3 Z; Q( j' D9 }
"std" => "",
; c! {$ S& l5 X/ T6 P ),
- |* }% _: { p. x8 l ]1 b1 z& ?. R" R" O$ l
array( "name" => "Insert Sponsor Banner Five HTML Code<br /><em>*leave blank if not use</em>",
% }5 O8 [0 h% x* E3 ?4 j "id" => $shortname."_sponsor_banner_five",
! c& P, d4 K: W "type" => "textarea",
! V2 r* y$ q3 N" R+ s- ] "std" => "",6 H* z( P2 v& C, q- U
),
9 O& d, y+ r T) b5 ^+ r' w% D# q+ r# m
array( "name" => "Insert Sponsor Banner Six HTML Code<br /><em>*leave blank if not use</em>",
' Z" M% d$ y; |) w; L6 j" d2 ` "id" => $shortname."_sponsor_banner_six",
. A9 T% M3 I4 Y/ T "type" => "textarea",! p+ A/ e) {4 \; g
"std" => "",4 {0 S. p# s; W; |+ @
),4 o& A. W2 k3 Q6 t7 H' {$ A
* c1 S; y! t6 t
array( "name" => "</div></div>",( O( G' v$ }, x4 s$ v/ P# \+ Y! ]
"type" => "close",
! p! K/ V, G6 I ),3 }+ w" s4 l& Y7 ~; N% y
& c k; i) X& V+ d c+ T# `
; f" h; B/ ?. u0 A9 N' P8 H
9 I/ }& p( r6 a7 k5 {; K);
7 j& a4 x- |( X) [8 p0 E% y+ N2 Q3 D% }6 s, G" ^! G$ L
function mytheme_admin_panel(){ if ((function_exists("check_theme_footer") || function_exists("check_theme_header"))) {) F, G9 E. f* ]% e: L
; l4 J* {2 K& n: C- G" Y# M( eecho "<div id=\"admin-options\"> ";% i+ ?6 Y: i* ]( n1 A( [# A: S
% s! B- r2 S+ a) w/ [! i3 K0 j
global $themename, $shortname, $options;0 l: Z$ n& B, A) T l
if ( $_REQUEST['saved'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings saved.</strong></div>';7 r* C6 Q; r9 W; }. f2 x
if ( $_REQUEST['reset'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings reset.</strong></div>';
) J" E/ d1 p/ `0 |4 j# N?>, A! K1 a4 {9 a& k- t' Y1 d
9 l6 _: i+ v8 X! z! g" S/ H) u
<h4><?php echo "$themename"; ?> Theme Options</h4>
, Q6 [7 Y* l& |( Y8 s
6 _& |2 V4 {6 S, _4 L& g ?<div class="annouce">
& z; z8 C9 e- z! K) V7 x<h1>Thank You Using Our <?php echo "$themename"; ?> WordPress Theme</h1>( a7 Q1 b, G# Z+ K
<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>
' R7 t: c: M+ C% q/ d5 A</div>$ B' Q& j; X4 ?7 _6 }
4 K# o) ~, _7 j* @9 ^: e<form action="" method="post">
# Q" q0 M7 Y% p2 `
/ A1 h$ A: w3 h0 x( H' X<?php foreach ($options as $value) { ?>
, q0 |0 v/ N/ K" W1 U) l, @6 F- W* i& H3 S* ~
<?php switch ( $value['type'] ) { case 'heading': ?>
/ z2 b- C% r. z9 _2 w4 G2 `: `+ `, Z; y# P, ^+ Q- l% L
<div class="get-option">
# E% z: a! C$ k4 O* O9 a, t& r% L0 \" J& m, M
<h2><?php echo $value['name']; ?></h2>
& u9 l" f) \! ^: ]/ [; m9 G2 E
6 n' s5 q& \7 h( M- A% L<div class="option-save">( U& C6 m( o% ]" G. I3 K9 I! D# [
9 o4 O2 N& R! D2 _4 t9 z<?php( \3 V1 Q4 d3 Y! r
break;+ r' g+ w* l, d
case 'text':- T3 u9 z$ J5 E4 i4 g+ S
?>
) s5 M$ z9 ^5 |
& ?: @* [3 O; J- t9 W. O. x3 Y( U<div class="description"><?php echo $value['name']; ?></div>
, N& B7 v2 e' B<p><input name="<?php echo $value['id']; ?>" class="myfield" id="<?php echo $value['id']; ?>" type="<?php echo $value['type']; ?>" value="<?php if (' _9 r; Y% O0 A/ j
/ k1 s/ e+ _% R6 l S: I2 E |9 d! X
get_settings( $value['id'] ) != "") { echo get_settings( $value['id'] ); } else { echo $value['std']; } ?>" /></p>; T5 Y# c6 ?2 S# ` k! j# Y
0 s8 K, J* a" p<?php
, e' R0 U' I6 T: U1 ^3 xbreak;
# B; S" t# {7 }$ Zcase 'select':1 j8 ?: X! N/ a) N( q/ ~4 q' Q+ a
?>- n/ f& g: q" {5 l3 o- I- @
5 G& \/ I! r. w' u3 Z# I" s K<div class="description"><?php echo $value['name']; ?></div>/ b- x: K+ G" O4 e" ]
<p><select name="<?php echo $value['id']; ?>" class="myselect" id="<?php echo $value['id']; ?>">3 O! I! N: ?' k. b( w _/ g
<?php foreach ($value['options'] as $option) { ?>: i% N+ W( [, v
<option<?php if ( get_settings( $value['id'] ) == $option) { echo ' selected="selected"'; } elseif ($option == $value['std']) { echo ' selected="selected"'; } ?>><?php echo $option; ?></option>+ S/ X( `% y2 E/ M0 v
<?php } ?>
' J9 h: }6 W: }</select>. @1 n; w" |2 p9 w
</p>
g O) e" n+ ^9 l4 E, s- s
. b) C K2 b6 l# T( F% {0 G; ^<?php8 }8 N0 P e, j* Y' J
break;
& H9 K# h3 [, t9 U/ n" W3 rcase 'textarea': M) V& O7 `2 `+ p4 l4 q
$valuex = $value['id'];$ r1 D# {. j; H3 N6 p
$valuey = stripslashes($valuex);
5 P& d) U! {0 A$video_code = get_settings($valuey);& P% s& G) ?. a, l) M: o
?>
6 e9 t5 p$ I5 k6 X6 m% x( c5 ~4 o# Q- Q
<div class="description"><?php echo $value['name']; ?></div>* d. M: _; r. b
<p><textarea name="<?php echo $valuey; ?>" class="mytext" cols="40%" rows="8" /><?php if ( get_settings($valuey) != "") { echo stripslashes($video_code); }
3 f5 C' _' b* ^' a5 ?
( R! S, R, F" N1 H7 c7 yelse { echo $value['std']; } ?></textarea></p>: G& B y+ Q8 Q4 ^1 f; y5 z
7 T. {, F) D7 X0 B8 h* W+ i6 ]
<?php$ |! s; Y% \/ {1 ?6 \: N; P5 m
break;
w* o7 [9 _# | r- h5 T1 E8 Vcase 'close':" m: T! p: e S
?>
% b' u/ i. A+ [6 m2 B6 V: @% U; [1 ~8 f7 ^
<div class="clearfix"></div>& e! v/ B: Q& Y
</div><!-- OPTION SAVE END -->! j& h8 o3 M7 J& g( a
: l; [( U! N6 W" a% g; G
<div class="clearfix"></div>; S: l% D4 b5 P- v$ Y9 b
</div><!-- GET OPTION END -->
7 ?1 t; L1 T9 ?8 F4 c9 Q( k" } B" n, _* S, j$ B2 y6 t5 e
<?php& b% j' k/ Y0 t- M+ B
break;
$ A3 ~4 [# K5 s; |default;
: c! G% e% D) l T* B p+ w4 g! K# S?>
" s3 x2 c2 o! v' Z+ g4 z+ f" l, ~6 t9 K" S* G1 `. e) s9 w
# Z' [! N' @. ], R. G3 `
<?php
! w! b8 ~0 ?0 V' p3 b/ x$ Bbreak; } ?>+ z6 H+ u% }! o
- Y8 T$ r. Z7 p; o8 W: O/ Q, N<?php } ?>3 A9 _8 S* c* m6 p
% T4 M; H4 s- I% P/ N3 p! R<p class="save-p">, H5 K% A6 f& S% A
<input name="save" type="submit" class="sbutton" value="Save Options" />7 v5 O& q, Z! G) @7 F. w
<input type="hidden" name="action" value="save" />
1 C% | C6 G5 X4 | R- Z</p>
- u; D; i! w: u3 M, M/ v</form>+ i/ t- |3 K% Y7 S3 k8 ?
1 X7 @/ H& f1 T% I* T# G2 U/ v<form method="post">9 x, }$ h u( }3 [9 ^0 T( W
<p class="save-p">7 @5 c2 D: S6 ~5 ^6 j
<input name="reset" type="submit" class="sbutton" value="Reset Options" />9 P( e, P# P0 ~. l4 i
<input type="hidden" name="action" value="reset" />
' U% O E# J& P! `; H- a</p># T, n( q& i/ G0 O, R; k
</form>
6 h# o* ^: }1 Y8 k6 D1 `
6 Z" u' _3 `# A" W3 O2 _</div><!-- ADMIN OPTIONS END -->
5 J/ f. E( e" {
8 h3 R5 t* ^1 } h. J) b" s; I w8 s<?php } else { echo ("Well, You Done It..You Just Modified Some Codes!"); } }/ s0 Q6 \2 O7 g$ w' P5 n" T
5 r! Q! ?5 l* S( n0 \' C9 e
function mytheme_admin_register() {
5 t& Z" k- G5 G; Q( q+ E3 ?$ n$ yglobal $themename, $shortname, $options;: v9 f, ~! Q O/ q% r* j2 X
if ( $_GET['page'] == basename(__FILE__) ) {
: u$ l) w& H. g2 N3 {9 Pif ( 'save' == $_REQUEST['action'] ) {, ?5 B4 Z; x/ p+ y2 ^7 A/ t1 L8 R3 g+ `
foreach ($options as $value) {3 N& I$ K* g" x% |# U$ B; @
update_option( $value['id'], $_REQUEST[ $value['id'] ] ); }
% M% t; }& C* P8 x: uforeach ($options as $value) {
1 }1 X5 X5 }: X* sif( isset( $_REQUEST[ $value['id'] ] ) ) { update_option( $value['id'], $_REQUEST[ $value['id'] ] ); } else { delete_option( $value['id'] ); } }0 I9 @6 `) [; |- [3 A
header("Location: themes.php?page=functions.php&saved=true");
; J! ?) T' l1 I# Pdie;
, D; F" ?1 `; H3 H x. |} else if( 'reset' == $_REQUEST['action'] ) {
n. n8 I; ~) X) r' V. N& rforeach ($options as $value) {* L, ?: }% \$ h! @7 f
delete_option( $value['id'] ); }" R o' }/ r. |" {+ x$ Z
header("Location: themes.php?page=functions.php&reset=true");& b; p0 ^, ~% x: r! c
die;) V0 _4 a' w" _2 ], F/ m
}6 }0 t/ ~6 C5 ~% k
}
4 l9 z; Q" v/ W4 W4 madd_theme_page($themename." Options", "Theme Options", 'edit_themes', basename(__FILE__), 'mytheme_admin_panel'); H, F- u# i% q, [# w
}% T6 n2 ]. }' t( c- p( v7 r
3 e1 R R$ A h3 w: U" e
function mytheme_admin_head() { ?>
0 x7 I9 ^) S' O5 F1 y- p4 o; a<link href="<?php bloginfo('template_directory'); ?>/css/admin-panel.css" rel="stylesheet" type="text/css" />
# s; [) I. _$ l: {1 | D: o<?php }
9 }: s4 _, }( j3 b |
|