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