|
|

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