|
|

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