|
|

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