|
|

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