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