|
|

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