|
|

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