|
|

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