|
|

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