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