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