|
|

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