|
|

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