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