|
|

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