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