|
|

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