|
|

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