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