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