|
|

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