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