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