|
|

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