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